aboutsummaryrefslogtreecommitdiffstats
path: root/markdown_extensions/codehilite.py
diff options
context:
space:
mode:
Diffstat (limited to 'markdown_extensions/codehilite.py')
-rw-r--r--markdown_extensions/codehilite.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/markdown_extensions/codehilite.py b/markdown_extensions/codehilite.py
index 890a66b..edfcedb 100644
--- a/markdown_extensions/codehilite.py
+++ b/markdown_extensions/codehilite.py
@@ -204,10 +204,9 @@ class CodeHiliteExtention(markdown.Extension):
text = "\n".join(detabbed).rstrip()+"\n"
code = CodeHilite(text, linenos=self.config['force_linenos'][0])
placeholder = md.htmlStash.store(code.hilite(), safe=True)
- if parent_elem.text:
- parent_elem.text += placeholder
- else:
- parent_elem.text = placeholder
+ # This wrapping p element will be removed when inserting raw html
+ p = markdown.etree.SubElement(parent_elem, 'p')
+ p.text = placeholder
md._processSection(parent_elem, theRest, inList)
md._processCodeBlock = _hiliteCodeBlock