Remove md_globals argument
See https://python-markdown.github.io/change_log/release-3.0/#md_globals-keyword-deprecated-from-extension-apiremotes/origin/4.0rc
parent
ed25497b37
commit
1102875d4b
|
@ -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')
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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"] = \
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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),
|
||||
|
|
Loading…
Reference in New Issue