Open allendav opened 9 years ago
cc @mattwiebe
Any news on this issue?
@alanhoff No news yet. We'll update this issue once we make progress on this.
Looks like we may be hitting this on the REST API Handbook on WordPress.org (the syncing process internally uses Jetpack Markdown). Other pages appear to be fine however.
This bug makes it difficult to use any of the code examples in the REST API Handbook. Every example requires a search and replace to get the correct quotes in place. Do we know what's causing this, yet?
The bug as described in the ticket appears to be a separate issue from what was being experienced in the REST API Handbook on w.org. I've fixed the handbook issue, which was reported as #meta3292 (there was too-broadly applied HTML entity handling).
The reported issue of entities getting encoded in the Visual Editor, particularly when toggling between the Text and Visual Editors, is one I've seen before and always chalked it up to TinyMCE and thus avoided use of the Visual Editor when including code. Handbook editors sometimes do input code in the Visual Editor, which often requires someone to manually fix them afterwards.
This issue has been marked as stale. This happened because:
No further action is needed. But it's worth checking if this ticket has clear reproduction steps and it is still reproducible. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation.
Entities (like ampersands) inside code fencing backticks get turned into HTML entities if the Visual mode of the editor is used to edit or compose a post (the Text mode leaves them alone), e.g.:
if ( false === $bar && $foo ) return $foobar;
becomes
if ( false === $bar && $foo ) return $foobar;
Just toggling into the visual mode and then back to text mode entity-izes the content. (This also happens inside code tags as well, unfortunately.)
Not sure if the fix lies with Markdown or with the Visual mode of the editor (or both).