|
ticket id 000030 |
status closed |
priority ??? |
assigned to Waylan |
Reported by: Tyler Lesmann Component: |
markdown creates em and strong elements without text nodes. This causes unintentional wacky rendering throughout the remainder of the page.
Try this and you will see what I mean.
>>> import markdown
>>> em_test = "** <-- This shouldn't be a em without a text node"
>>> markdown.markdown(em_test)
u"<p><em /> <-- This shouldn't be a em without a text node</p>"
I've have fixed this with a postprocessor.
import re
BAD_TAGS_RE = re.compile(r'<(?=em|strong).*?/>')
class FixEmptiesPostprocessor(Postprocessor):
def run(self, text):
text = "".join(BAD_TAGS_RE.split(text))
return text
Resolution
fixed