Miguel Gonzalez 2018-10-30 15:46:53 +01:00 committed by Alex Hermida
parent ed25497b37
commit 1102875d4b
10 changed files with 10 additions and 10 deletions

View File

@ -37,7 +37,7 @@ class AutolinkExtension(markdown.Extension):
* GitHub only accepts URLs with protocols or "www.", whereas Gruber's regex
accepts things like "foo.com/bar".
"""
def extendMarkdown(self, md, md_globals):
def extendMarkdown(self, md):
url_re = r'(?i)\b((?:(?:ftp|https?)://|www\d{0,3}[.])([^\s<>]+))'
autolink = AutolinkPattern(url_re, md)
md.inlinePatterns.add('gfm-autolink', autolink, '_end')

View File

@ -19,7 +19,7 @@ class AutomailPattern(markdown.inlinepatterns.Pattern):
class AutomailExtension(markdown.Extension):
"""An extension that turns all email addresses into links."""
def extendMarkdown(self, md, md_globals):
def extendMarkdown(self, md):
mail_re = r'\b(?i)([a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]+)\b'
automail = AutomailPattern(mail_re, md)
md.inlinePatterns.add('gfm-automail', automail, '_end')

View File

@ -152,7 +152,7 @@ EMOJIS_SET = {
class EmojifyExtension(Extension):
def extendMarkdown(self, md, md_globals):
def extendMarkdown(self, md):
md.registerExtension(self)
md.preprocessors.add('emojify',
EmojifyPreprocessor(md),

View File

@ -30,7 +30,7 @@ from markdown.util import etree, AtomicString
class MentionsExtension(Extension):
def extendMarkdown(self, md, md_globals):
def extendMarkdown(self, md):
MENTION_RE = r"(@)([\w.-]+)"
mentionsPattern = MentionsPattern(MENTION_RE)
mentionsPattern.md = md

View File

@ -36,7 +36,7 @@ class TaigaReferencesExtension(Extension):
self.project = project
return super().__init__(*args, **kwargs)
def extendMarkdown(self, md, md_globals):
def extendMarkdown(self, md):
TAIGA_REFERENCE_RE = r'(?<=^|(?<=[^a-zA-Z0-9-\[]))#(\d+)'
referencesPattern = TaigaReferencesPattern(TAIGA_REFERENCE_RE, self.project)
referencesPattern.md = md

View File

@ -28,6 +28,6 @@ class SemiSaneListExtension(markdown.Extension):
newlines.
"""
def extendMarkdown(self, md, md_globals):
def extendMarkdown(self, md):
md.parser.blockprocessors['olist'] = SemiSaneOListProcessor(md.parser)
md.parser.blockprocessors['ulist'] = SemiSaneUListProcessor(md.parser)

View File

@ -31,7 +31,7 @@ class SpacedLinkExtension(markdown.Extension):
extension adds such support.
"""
def extendMarkdown(self, md, md_globals):
def extendMarkdown(self, md):
md.inlinePatterns["link"] = \
markdown.inlinepatterns.LinkPattern(SPACED_LINK_RE, md)
md.inlinePatterns["reference"] = \

View File

@ -14,6 +14,6 @@ class StrikethroughExtension(markdown.Extension):
For example: ``~~strike~~``.
"""
def extendMarkdown(self, md, md_globals):
def extendMarkdown(self, md):
pattern = markdown.inlinepatterns.SimpleTagPattern(STRIKE_RE, 'del')
md.inlinePatterns.add('gfm-strikethrough', pattern, '_end')

View File

@ -28,7 +28,7 @@ from taiga.front.templatetags.functions import resolve
class TargetBlankLinkExtension(markdown.Extension):
"""An extension that add target="_blank" to all external links."""
def extendMarkdown(self, md, md_globals):
def extendMarkdown(self, md):
md.treeprocessors.add("target_blank_links",
TargetBlankLinksTreeprocessor(md),
"<prettify")

View File

@ -34,7 +34,7 @@ class WikiLinkExtension(Extension):
self.project = project
return super().__init__(*args, **kwargs)
def extendMarkdown(self, md, md_globals):
def extendMarkdown(self, md):
WIKILINK_RE = r"\[\[([\w0-9_ -]+)(\|[^\]]+)?\]\]"
md.inlinePatterns.add("wikilinks",
WikiLinksPattern(md, WIKILINK_RE, self.project),