diff options
author | Waylan Limberg <waylan@gmail.com> | 2008-09-20 18:14:17 -0400 |
---|---|---|
committer | Waylan Limberg <waylan@gmail.com> | 2008-09-20 18:14:17 -0400 |
commit | ca45f4c69eb87d4361a46d758a0936d63dbdee50 (patch) | |
tree | e9270848232982862607875efc0e1262ed5ab4f9 /markdown_extensions | |
parent | 56cd793408ae2667e631d8913653eb5fec568545 (diff) | |
download | markdown-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.
Diffstat (limited to 'markdown_extensions')
-rw-r--r-- | markdown_extensions/wikilinks.py | 3 |
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) |