Markdown: MARKDOWN_HASH appearing in output #7535
Labels
[Feature] Markdown
[Pri] Normal
[Type] Bug
When a feature is broken and / or not performing as intended
Milestone
馃憢 There appears to be a bug with code blocks inside shortcodes.
single_line_code_preserve
is called first, replacing code tags with their hash markers.shortcode_preserve
is then called, replacing shortcodes with their hash markers. After the Markdown parsing, hashes are then removed.However, since the code tags were removed first, they're first in the array and are restored first. The shortcodes are then restored afterwards. This means that the code tags are never restored.
The simplest solution here is simply to reverse the hash array before restoration. Happy to PR if that seems sensible.
(Hitting this on WordPress.org while working on meta2968.)
Steps to reproduce the issue
Register a test shortcode. The callback doesn't matter (it just needs to be registered so it gets added to the regex).
Create a post with the following content:
What I expected
Output of:
What happened instead
Output of:
The text was updated successfully, but these errors were encountered: