You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2018/09/13 19:24:10 UTC

[06/12] allura git commit: Use custom regex for short links

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 <sh...@gmail.com>
Authored: Sun Sep 2 19:41:46 2018 +0530
Committer: Dave Brondsema <db...@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)