Solved

Literal Dialog adds BR Tag

  • 24 April 2023
  • 2 replies
  • 77 views

Userlevel 3
Badge +5

I am displaying HTML saved by the rich text editor in a literal dialog message, but it’s adding <br> tags which aren’t in the original HTML.

Has anyone else noticed this? Is there a way to prevent it?

icon

Best answer by TinTex 24 April 2023, 19:10

View original

2 replies

Userlevel 3
Badge +10

It looks like this may be a documented considerations:

  • If you save data from the Design tab to a SmartObject or database and the data is not saved correctly such as with line breaks, you must switch to the HTML tab before saving the data to get the correct results.

https://help.nintex.com/en-US/k2five/userguide/current/Content/Create/K2Designer/Controls/RichText/RichTextControl.htm

Userlevel 3
Badge +5

Thanks for that. Of interest, the HTML saved, does not include <br> tags, which is good but I still get <br> tags added to the dialog box.

This is hacky but it works. I added a transfer data to a literal, as an “and” rule with Show a message. Basically clears the br tags 50 milliseconds after loading.

<script>setTimeout(()=>{let element = document.querySelectorAll(".message br"); for (index = element.length - 1; index >= 0; index--) {element[index].parentNode.removeChild(element[index])}},50)</script>

Reply