##// END OF EJS Templates
markdown: enable full githubFlavoredMarkdown
marcink -
r317:2f438a3b default
parent child Browse files
Show More
@@ -22,6 +22,8 b' import re'
22 22
23 23 import markdown
24 24
25 from mdx_gfm import GithubFlavoredMarkdownExtension # noqa
26
25 27
26 28 class FlavoredCheckboxExtension(markdown.Extension):
27 29
@@ -65,8 +67,6 b' class FlavoredCheckboxPostprocessor(mark'
65 67 return html.replace(before, after)
66 68
67 69
68
69
70 70 # Global Vars
71 71 URLIZE_RE = '(%s)' % '|'.join([
72 72 r'<(?:f|ht)tps?://[^>]*>',
@@ -75,6 +75,7 b" URLIZE_RE = '(%s)' % '|'.join(["
75 75 r'[^(<\s]+\.(?:com|net|org)\b',
76 76 ])
77 77
78
78 79 class UrlizePattern(markdown.inlinepatterns.Pattern):
79 80 """ Return a link Element given an autolink (`http://example/com`). """
80 81 def handleMatch(self, m):
@@ -33,7 +33,8 b' from docutils.core import publish_parts'
33 33 from docutils.parsers.rst import directives
34 34 import markdown
35 35
36 from rhodecode.lib.markdown_ext import FlavoredCheckboxExtension, UrlizeExtension
36 from rhodecode.lib.markdown_ext import (
37 UrlizeExtension, GithubFlavoredMarkdownExtension)
37 38 from rhodecode.lib.utils2 import safe_unicode, md5_safe, MENTIONS_REGEX
38 39
39 40 log = logging.getLogger(__name__)
@@ -147,9 +148,7 b' class MarkupRenderer(object):'
147 148 # the safe_mode=True parameter of the markdown method.
148 149 extensions = ['codehilite', 'extra', 'def_list', 'sane_lists']
149 150 if flavored:
150 extensions.append('nl2br')
151 extensions.append(FlavoredCheckboxExtension())
152 extensions.append(UrlizeExtension())
151 extensions.append(GithubFlavoredMarkdownExtension())
153 152
154 153 if mentions:
155 154 mention_pat = re.compile(MENTIONS_REGEX)
General Comments 0
You need to be logged in to leave comments. Login now