<s> import markdown <EOL> from markdown . extensions import Extension <EOL> from django import template <EOL> from django . utils . safestring import mark_safe <EOL> register = template . Library ( ) <EOL> class EscapeHtml ( Extension ) : <EOL> def extendMarkdown ( self , md , md_globals ) : <EOL> del md . preprocessors [ '<STR_LIT>' ] <EOL> del md . inlinePatterns [ '<STR_LIT:html>' ] <EOL> @ register . filter <EOL> def markdown_render ( value ) : <EOL> return mark_safe ( markdown . markdown ( value , extensions = [ EscapeHtml ( ) , '<STR_LIT>' , '<STR_LIT>' ] ) ) </s>
