allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [06/12] allura git commit: Use custom regex for short links
Date Thu, 13 Sep 2018 19:24:10 GMT
Use custom regex for short links


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/20af3a7d
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/20af3a7d
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/20af3a7d

Branch: refs/heads/master
Commit: 20af3a7d28bed4eecbe30a479cb2ebf681419da7
Parents: 68f6da2
Author: Shalitha <shalithasuranga@gmail.com>
Authored: Sun Sep 2 19:41:46 2018 +0530
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Thu Sep 13 19:18:27 2018 +0000

----------------------------------------------------------------------
 Allura/allura/lib/markdown_extensions.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/20af3a7d/Allura/allura/lib/markdown_extensions.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/markdown_extensions.py b/Allura/allura/lib/markdown_extensions.py
index d87687b..14724ed 100644
--- a/Allura/allura/lib/markdown_extensions.py
+++ b/Allura/allura/lib/markdown_extensions.py
@@ -256,7 +256,7 @@ class ForgeExtension(markdown.Extension):
         md.inlinePatterns.add('autolink_without_brackets', AutolinkPattern(r'(http(?:s?)://[a-zA-Z0-9./\-\\_%?&=+#;~:!]+)',
md), '<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.NOIMG
+ '\\[([^ x\\]]+)\\]', 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)


Mime
View raw message