From 245eecad314b2aef0a2e35c35043d0ef8adc4eed Mon Sep 17 00:00:00 2001 From: Scott Bahling Date: Thu, 7 Nov 2013 12:58:00 +0100 Subject: Fix internal link regex --- panfry/document.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'panfry') diff --git a/panfry/document.py b/panfry/document.py index eec8aea..744914c 100755 --- a/panfry/document.py +++ b/panfry/document.py @@ -69,7 +69,7 @@ class Document(object): returns: markdown source with expanded links ''' - re_link1 = re.compile(r'(\[(?P[^\]^]+)\])\((?P#.*)\)', re.S) + 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) source = re_link1.sub(self._get_cross_link, source) -- cgit v1.2.3