mirror of
https://github.com/DarrenOfficial/dpaste.git
synced 2024-11-15 08:02:54 +11:00
Do not allow custom HTML in Markdown.
This commit is contained in:
parent
76e8ddf3ea
commit
46fbe577c5
1 changed files with 6 additions and 4 deletions
|
@ -67,13 +67,15 @@ class PlainTextHighlighter(Highlighter):
|
||||||
|
|
||||||
class MarkdownHighlighter(PlainTextHighlighter):
|
class MarkdownHighlighter(PlainTextHighlighter):
|
||||||
"""Markdown"""
|
"""Markdown"""
|
||||||
|
extensions = ('tables', 'fenced-code', 'footnotes', 'autolink,',
|
||||||
|
'strikethrough', 'underline', 'quote', 'superscript',
|
||||||
|
'math')
|
||||||
|
render_flags = ('skip-html',)
|
||||||
|
|
||||||
def highlight(self, code_string, lexer_name=None):
|
def highlight(self, code_string, lexer_name=None):
|
||||||
import misaka
|
import misaka
|
||||||
extensions = ('tables', 'fenced-code', 'footnotes', 'autolink,',
|
return mark_safe(misaka.html(code_string, extensions=self.extensions,
|
||||||
'strikethrough', 'underline', 'quote', 'superscript',
|
render_flags=self.render_flags))
|
||||||
'math')
|
|
||||||
return mark_safe(misaka.html(code_string, extensions=extensions))
|
|
||||||
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in a new issue