Index: cms/converters.py |
=================================================================== |
--- a/cms/converters.py |
+++ b/cms/converters.py |
@@ -312,22 +312,22 @@ |
def remove_unnecessary_entities(match): |
char = unichr(int(match.group(1))) |
if char in html_escapes: |
return match.group(0) |
else: |
return char |
escapes = {} |
- for char in markdown.Markdown.ESCAPED_CHARS: |
+ md = markdown.Markdown(output='html5', extensions=['extra']) |
+ for char in md.ESCAPED_CHARS: |
escapes[char] = '&#' + str(ord(char)) + ';' |
for key, value in html_escapes.iteritems(): |
escapes[key] = value |
- md = markdown.Markdown(output='html5', extensions=['extra']) |
md.preprocessors['html_block'].markdown_in_raw = True |
def to_html(s): |
return re.sub(r'</?p>', '', md.convert(s)) |
result = self.insert_localized_strings(source, escapes, to_html) |
result = md.convert(result) |
result = re.sub(r'&#(\d+);', remove_unnecessary_entities, result) |