This is an automated email from the ASF dual-hosted git repository.

kentontaylor pushed a commit to branch kt/markdown-upgrade
in repository https://gitbox.apache.org/repos/asf/allura.git

commit bf7b025249c9f66e7ce8b1a860b83ccea0de6614
Author: Kenton Taylor <[email protected]>
AuthorDate: Mon Sep 27 19:03:06 2021 +0000

    markdown upgrade WIP
---
 Allura/allura/lib/markdown_extensions.py | 12 ++++++------
 requirements.in                          |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/Allura/allura/lib/markdown_extensions.py 
b/Allura/allura/lib/markdown_extensions.py
index ba36796..6b9c26f 100644
--- a/Allura/allura/lib/markdown_extensions.py
+++ b/Allura/allura/lib/markdown_extensions.py
@@ -258,7 +258,7 @@ class ForgeExtension(markdown.Extension):
                               '<escape')
         # replace the link pattern with our extended version
         md.inlinePatterns['link'] = 
ForgeLinkPattern(markdown.inlinepatterns.LINK_RE, md, ext=self)
-        md.inlinePatterns['short_reference'] = 
ForgeLinkPattern(markdown.inlinepatterns.SHORT_REF_RE, md, ext=self)
+        md.inlinePatterns['short_reference'] = 
ForgeLinkPattern(markdown.inlinepatterns.REFERENCE_RE, md, ext=self)
         # macro must be processed before links
         md.inlinePatterns.add('macro', ForgeMacroPattern(MACRO_PATTERN, md, 
ext=self), '<link')
         self.forge_link_tree_processor = ForgeLinkTreeProcessor(md)
@@ -287,10 +287,10 @@ class EmojiExtension(markdown.Extension):
 
 
 class EmojiInlinePattern(markdown.inlinepatterns.Pattern):
-    
+
     def __init__(self, pattern):
         markdown.inlinepatterns.Pattern.__init__(self, pattern)
-        
+
     def handleMatch(self, m):
         emoji_code = m.group(2)
         return emoji.emojize(emoji_code, use_aliases=True)
@@ -327,15 +327,15 @@ class 
UserMentionInlinePattern(markdown.inlinepatterns.Pattern):
         return result
 
 
-class ForgeLinkPattern(markdown.inlinepatterns.LinkPattern):
+class ForgeLinkPattern(markdown.inlinepatterns.LinkInlineProcessor):
 
     artifact_re = re.compile(r'((.*?):)?((.*?):)?(.+)')
 
     def __init__(self, *args, **kwargs):
         self.ext = kwargs.pop('ext')
-        markdown.inlinepatterns.LinkPattern.__init__(self, *args, **kwargs)
+        markdown.inlinepatterns.LinkInlineProcessor.__init__(self, *args, 
**kwargs)
 
-    def handleMatch(self, m):
+    def handleMatch(self, m, data):
         el = markdown.util.etree.Element('a')
         el.text = m.group(2)
         is_link_with_brackets = False
diff --git a/requirements.in b/requirements.in
index 0627b83..23e1763 100644
--- a/requirements.in
+++ b/requirements.in
@@ -14,7 +14,7 @@ FormEncode>=2
 GitPython<=3.1.23
 html5lib
 Jinja2
-Markdown<3
+Markdown==3.0
 markdown-checklist==0.4.1
 MarkupSafe
 Ming==0.11.1

Reply via email to