Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: cms/converters.py

Issue 29886562: Noissue - use markdown module better to avoid warnings (Closed)
Patch Set: Created Sept. 20, 2018, 2:07 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cms/converters.py
===================================================================
--- a/cms/converters.py
+++ b/cms/converters.py
@@ -322,17 +322,19 @@
def get_html(self, source, filename):
def remove_unnecessary_entities(match):
char = unichr(int(match.group(1)))
if char in html_escapes:
return match.group(0)
return char
escapes = {}
- md = markdown.Markdown(output='html5', extensions=['extra'])
+ md = markdown.Markdown(output='html5', extensions=[
+ 'markdown.extensions.extra',
+ ])
for char in md.ESCAPED_CHARS:
escapes[char] = '&#{};'.format(str(ord(char)))
for key, value in html_escapes.iteritems():
escapes[key] = value
md.preprocessors['html_block'].markdown_in_raw = True
def to_html(s):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld