Open jencijanos opened 1 month ago
Example:
Input markdown text:
~~~
({
'&': '&',
'<': '<',
'>': '>',
'"': '"',
"'": '''
}
[tag])
~~~
After Publis post in /wp-admin/post.php $_REQUEST['content']
i see:
~~~\r\n({\r\n\\'&\\': \\'&\\',\r\n\\'<\\': \\'<\\',\r\n\\'>\\': \\'>\\',\r\n\\'\\"\\': \\'"\\',\r\n\\"\\'\\": \\''\\'\r\n}\r\n[tag])\r\n~~~\r\n
And in wp-githuber-md/src/Controllers/Markdown.php
function wp_insert_post_data
the $post_data['post_content']
contain:
~~~\r\n({\r\n'&': '&',\r\n'<': '<',\r\n'>': '>',\r\n'"': '"',\r\n"'": '&apos;'\r\n}\r\n[tag])\r\n~~~\r\n
The >
symbol converted to >
but ">"
entity isn't changed, not converted to &gt;
. Same situation with other symbols
I don't know where these changes happen, but maybe outside the plugin
Describe the bug
Symbols such as
>
,<
, and"
are converted to their ampersand variants when used inside a code block, but they remain unchanged when outside a code blockTo reproduce
I create a post and publish it. After I press publish
>
and<
get’s immediately converted to>
and<
in the original markdown text. The markdown text was not saved correctly to the database. See "Additional context"Expected behavior
I expect keep original text inside code blocks.
Screenshots
Visual changes after publish
Data stored in DB
Server environment
Clean install, no other plugins or special settings applied.
User environment
Additional context
Data from DB
post_content_filtered
Expected markdown text