diff options
Diffstat (limited to 'yarnlib')
-rw-r--r-- | yarnlib/mdparser.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/yarnlib/mdparser.py b/yarnlib/mdparser.py index 4bd59d3..67851ec 100644 --- a/yarnlib/mdparser.py +++ b/yarnlib/mdparser.py @@ -17,6 +17,7 @@ import logging +import HTMLParser import markdown import StringIO from markdown.treeprocessors import Treeprocessor @@ -40,10 +41,12 @@ class GatherCodeBlocks(Treeprocessor): self.blocks = blocks def run(self, root): + h = HTMLParser.HTMLParser() for child in root.getchildren(): if child.tag == 'pre': code = child.find('code') - self.blocks.append(code.text) + text = h.unescape(code.text) + self.blocks.append(text) return root # This is the Python Markdown extension to call the code block |