From 0ae9fa303ff901309956e30d7029f93a485068f3 Mon Sep 17 00:00:00 2001 From: Scott Bahling Date: Thu, 7 Nov 2013 17:57:10 +0100 Subject: More regex fixes for the internal link processing --- panfry/document.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/panfry/document.py b/panfry/document.py index 744914c..09a728d 100755 --- a/panfry/document.py +++ b/panfry/document.py @@ -70,8 +70,8 @@ class Document(object): returns: markdown source with expanded links ''' re_link1 = re.compile(r'(\[(?P[^\]^]+)\])\((?P#[^\)]*)\)', re.S) - re_link2 = re.compile(r'(\[(?P[^\]^]+)\][^(])', re.S) - re_link3 = re.compile(r'(\[(?P[^\]^]+)\])\[(?P[^\]].*)\]', re.S) + re_link2 = re.compile(r'(\[(?P[^\]^]+)\])\[(?P[^\]]*)\]', re.S) + re_link3 = re.compile(r'(\[(?P[^\]^]+)\][^(])', re.S) source = re_link1.sub(self._get_cross_link, source) source = re_link2.sub(self._get_cross_link, source) source = re_link3.sub(self._get_cross_link, source) -- cgit v1.2.3