aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2008-09-20 18:14:17 -0400
committerWaylan Limberg <waylan@gmail.com>2008-09-20 18:14:17 -0400
commitca45f4c69eb87d4361a46d758a0936d63dbdee50 (patch)
treee9270848232982862607875efc0e1262ed5ab4f9
parent56cd793408ae2667e631d8913653eb5fec568545 (diff)
downloadmarkdown-ca45f4c69eb87d4361a46d758a0936d63dbdee50.tar.gz
markdown-ca45f4c69eb87d4361a46d758a0936d63dbdee50.tar.bz2
markdown-ca45f4c69eb87d4361a46d758a0936d63dbdee50.zip
[Wikilinks] Restricted regex to only match [[bracketed links]] with safe chars: 'A-Za-z0-9_-' and space.
-rw-r--r--markdown_extensions/wikilinks.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/markdown_extensions/wikilinks.py b/markdown_extensions/wikilinks.py
index 637b87c..4ecbd01 100644
--- a/markdown_extensions/wikilinks.py
+++ b/markdown_extensions/wikilinks.py
@@ -88,8 +88,7 @@ class WikiLinkExtension (markdown.Extension) :
self.md = md
# append to end of inline patterns
- WIKILINK_RE = r'\[\[([^\]]+)\]\]'
- #r'''(?P<escape>\\|\b)(?P<camelcase>([A-Z]+[a-z-_]+){2,})\b'''
+ WIKILINK_RE = r'\[\[([A-Za-z0-9_ -]+)\]\]'
WIKILINK_PATTERN = WikiLinks(WIKILINK_RE, self.config)
WIKILINK_PATTERN.md = md
md.inlinePatterns.append(WIKILINK_PATTERN)