"&" shows as "&" in editor, but "&" on front-end

Found a pretty embarrassing bug (well, it embarrassed my client at least).

Certain text shows properly when editing but then changes to HTML code for the character when viewed on the front end (shown).

In this case, we copied from a Word doc a line of text, using CTRL-SHIFT-V (which copies the text w/o any formatting). Upon inspection after discovering this glitch, the text for the ampersand in the raw text editor (sidebar) shows as &. In the rich editor (sidebar) it shows as & But in the main area (i.e. inline), only the ampersand shows and not the additional bogus text.

If you guys can get this to be consistent so if there is an error in the text it’s showing on the back end and front end the same, awesome.

Hi @co50,

We’re sorry you’re having this issue. Word has some extra information added to the text for the formatting, so it is a good idea to have it added to some simple text editor such as notepad or sublime text first and then copy it to the element. In our elements, if you see we have an HTML and Rich Text views when we want to add something. Usually if the HTMl mode is selected, copying directly from Word should not bring the formatting information. But if the tab is in rich text mode it will import the formatting and try to mimic the formatting using inline HTML stuff.

I tried a sample. See it here: https://screencast-o-matic.com/watch/cq1T1mTN4Y
That is using Libre Office Writer, but I ask my colleague and it is the same for Office word. On your case, the text you copied might have different formatting. Try to copy it first on a text editor like notepage/sublime text and then try again. Text element shouldn’t convert text format from & to &.

Hope this helps.

I think you missed the point here…ignore the source of the original text…that isn’t important.

What I pointed out is if you type/paste & inline (by double clicking the text), the visual editor displays it as entered until you click off to finalize the edit. At that point it shows as just & in the editor. But if you load up the page in a browser, the full & shows. That is the bug. Everything should display it the same way. This is your app so you’re in full control of what it displays when inline editing.

Hi @co50,

Thank you for the detailed report. I did test the case on my local installation and see the bug. I reported this into our issue tracker.

Thank you for taking time and reporting this bug. Meanwhile, to avoid having this, you need to select the HTML mode and not Rich Text mode of the editor. Then if you add & it will show correctly in the front end.

Will show correctly:

Will show incorrectly (bug):

Thank you.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.