-
Notifications
You must be signed in to change notification settings - Fork 875
codehilite extension double escapes HTML #725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'll take a look at this today when I get some time. |
Thanks. I created a pull request that fixes it a quick and dirty way. Since the extensions seem to get markup after it's been escaped, this seemed like the only obvious way to resolve the problem short of refactoring how Python-Markdown processes extensions. |
I'll have to take a look, because this may unescape intentional escaped, literal syntax. |
I don't think this used to be the case. I imagine this was introduced in recent refactoring or pull request. I'll get to the bottom of this though. |
Yes, I introduced this I think when adjusting escapes in the serializer. We now escape the code when it is intially found by the code block processors. There should be no risk in unescaping literals. The proper approach is probably unescaping the content before processing it. I'll confirm in a bit. |
We can bump the Markdown version when Python-Markdown/markdown#725 is released
Here's an example:
As you can see, my example file includes a Markdown example with > characters. Unfortunately, with Codehilite enabled, it produces doubly-escaped content. Here's the output of that script:
See those
&>
parts? That means your HTML output includes the > characters escaped twice. It should be just>>>
, not>>>
.The text was updated successfully, but these errors were encountered: