Automattic / Automattic/jetpack

Markdown: unwanted entity encoding occurs inside backticks

Open
#2,068 7 comments 0 reactions 1 assignee Claimed by @mattwiebe View on GitHub
[Feature] Markdown [Pri] Normal [Status] Stale Bug
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

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).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.