syntaxhighlighter icon indicating copy to clipboard operation
syntaxhighlighter copied to clipboard

& get's escaped multiple times in TinyMCE 4

Open moorscode opened this issue 8 years ago • 4 comments

When using TinyMCE 4 a problem can occur with the escaping of & characters.

There is a blind search and replace of & to &. In the TinyMCE javascript there is unescaping and escaping for pre_wpautop and wpautop which should avoid this problem.

The solution which worked best for me is to add an additional replace to make sure there are no & occurences in the shortcode content.

moorscode avatar Mar 23 '17 13:03 moorscode

How to reproduce: Press undo on an editor and see the HTML tags get escaped even if the text int he code blocks has not been affected by the undo-action.

moorscode avatar Mar 26 '17 13:03 moorscode

I use TinyMCE and it seems like < and > get escaped when using syntaxhighlighter language java multitple times while editing around and publishing articles

ghost avatar Dec 11 '17 10:12 ghost

I looked into this earlier. The encoding happened here, but the decoding here was never reached.

I reverted commit e5ecc36 (only the two js'es of course) and everything works perfectly. No double quoting, no console errors, no nothing.

Too lazy to find out the root cause, or why the change happened in the first place. Hot-fixed and happy.

dujiulun avatar Apr 03 '20 10:04 dujiulun

We seem to still be encountering this via the Classic Editor. This affects other special characters as well like >.

There are a few different scenarios that seem might trigger this, one being:

  • New post, opens with code editor
  • post code in editor
  • switch to visual editor
  • contents inside visual editor are now incorrect

jaredatch avatar Oct 29 '20 16:10 jaredatch