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"""
|
||||||
|
|
||||||
def highlight(self, code_string, lexer_name=None):
|
|
||||||
import misaka
|
|
||||||
extensions = ('tables', 'fenced-code', 'footnotes', 'autolink,',
|
extensions = ('tables', 'fenced-code', 'footnotes', 'autolink,',
|
||||||
'strikethrough', 'underline', 'quote', 'superscript',
|
'strikethrough', 'underline', 'quote', 'superscript',
|
||||||
'math')
|
'math')
|
||||||
return mark_safe(misaka.html(code_string, extensions=extensions))
|
render_flags = ('skip-html',)
|
||||||
|
|
||||||
|
def highlight(self, code_string, lexer_name=None):
|
||||||
|
import misaka
|
||||||
|
return mark_safe(misaka.html(code_string, extensions=self.extensions,
|
||||||
|
render_flags=self.render_flags))
|
||||||
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in a new issue