summaryrefslogtreecommitdiff
path: root/markdown/extensions/codehilite.py
diff options
context:
space:
mode:
Diffstat (limited to 'markdown/extensions/codehilite.py')
-rw-r--r--markdown/extensions/codehilite.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/markdown/extensions/codehilite.py b/markdown/extensions/codehilite.py
index 915dfcf..9eed561 100644
--- a/markdown/extensions/codehilite.py
+++ b/markdown/extensions/codehilite.py
@@ -225,9 +225,11 @@ class HiliteTreeprocessor(Treeprocessor):
def code_unescape(self, text):
"""Unescape code."""
- text = text.replace("&", "&")
text = text.replace("&lt;", "<")
text = text.replace("&gt;", ">")
+ # Escaped '&' should be replaced at the end to avoid
+ # conflicting with < and >.
+ text = text.replace("&amp;", "&")
return text
def run(self, root):