You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
HiliteTreeprocessor doesn't leave escaped HTML entities intact. #988
diff --git markdown/extensions/codehilite.py markdown/extensions/codehilite.py
index 915dfcf..9eed561 100644
--- markdown/extensions/codehilite.py+++ markdown/extensions/codehilite.py@@ -225,9 +225,11 @@ class HiliteTreeprocessor(Treeprocessor):
def code_unescape(self, text):
"""Unescape code."""
- text = text.replace("&", "&")
text = text.replace("<", "<")
text = text.replace(">", ">")
+ # Escaped '&' should be replaced at the end to avoid+ # conflicting with < and >.+ text = text.replace("&", "&")
return text
def run(self, root):
Would you be willing to have a patch+tests for this?
changed the title [-]HiliteTreeprocessor doesn't let HTML entities be.[/-][+]HiliteTreeprocessor doesn't leave escaped HTML entities intact.[/+]on Jun 25, 2020
Activity
[-]HiliteTreeprocessor doesn't let HTML entities be.[/-][+]HiliteTreeprocessor doesn't leave escaped HTML entities intact.[/+]aero31aero commentedon Jun 25, 2020
The code to reproduce: http://p.ip.fi/R90X
waylan commentedon Jun 25, 2020
A PR is welcome.
Fix unescaping of HTML characters <> in CodeHilite.
Fix unescaping of HTML characters <> in CodeHilite.
Fix unescaping of HTML characters <> in CodeHilite.
Fix unescaping of HTML characters <> in CodeHilite.
Fix unescaping of HTML characters <> in CodeHilite. (#990)