##// END OF EJS Templates
markdown: fixed sanitization of checkbox extensions that removed "checked" attribute....
dan -
r3528:74d317ee stable
parent child Browse files
Show More
@@ -70,7 +70,7 b' markdown_attrs = {'
70 70 "abbr": ["title"],
71 71 "acronym": ["title"],
72 72 "pre": ["lang"],
73 "input": ["type", "disabled"]
73 "input": ["type", "disabled", "checked"]
74 74 }
75 75
76 76 standard_styles = [
@@ -18,26 +18,11 b''
18 18 # RhodeCode Enterprise Edition, including its added features, Support services,
19 19 # and proprietary license terms, please see https://rhodecode.com/licenses/
20 20
21 import re
22
23 21 import markdown
24 22
25 23 from mdx_gfm import GithubFlavoredMarkdownExtension # pragma: no cover
26 24
27 25
28 class FlavoredCheckboxPostprocessor(markdown.postprocessors.Postprocessor):
29 """
30 Adds `flavored_checkbox_list` class to list of checkboxes
31 """
32
33 pattern = re.compile(r'^([*-]) \[([ x])\]')
34
35 def run(self, html):
36 before = '<ul>\n<li><input type="checkbox"'
37 after = '<ul class="flavored_checkbox_list">\n<li><input type="checkbox"'
38 return html.replace(before, after)
39
40
41 26 # Global Vars
42 27 URLIZE_RE = '(%s)' % '|'.join([
43 28 r'<(?:f|ht)tps?://[^>]*>',
General Comments 0
You need to be logged in to leave comments. Login now