markdown: fixed sanitization of checkbox extensions that removed "checked" attribute.

- Fixes #5513
This commit is contained in:
Daniel Dourvaris 2019-03-01 10:02:46 +01:00
parent cf9df9d814
commit cbd41c4079
2 changed files with 1 additions and 16 deletions

View file

@ -70,7 +70,7 @@ markdown_attrs = {
"abbr": ["title"],
"acronym": ["title"],
"pre": ["lang"],
"input": ["type", "disabled"]
"input": ["type", "disabled", "checked"]
}
standard_styles = [

View file

@ -18,26 +18,11 @@
# RhodeCode Enterprise Edition, including its added features, Support services,
# and proprietary license terms, please see https://rhodecode.com/licenses/
import re
import markdown
from mdx_gfm import GithubFlavoredMarkdownExtension # pragma: no cover
class FlavoredCheckboxPostprocessor(markdown.postprocessors.Postprocessor):
"""
Adds `flavored_checkbox_list` class to list of checkboxes
"""
pattern = re.compile(r'^([*-]) \[([ x])\]')
def run(self, html):
before = '<ul>\n<li><input type="checkbox"'
after = '<ul class="flavored_checkbox_list">\n<li><input type="checkbox"'
return html.replace(before, after)
# Global Vars
URLIZE_RE = '(%s)' % '|'.join([
r'<(?:f|ht)tps?://[^>]*>',