diff options
| author | Scott Bahling <sbahling@suse.de> | 2013-11-07 17:57:10 +0100 |
|---|---|---|
| committer | Scott Bahling <sbahling@suse.de> | 2013-11-07 17:57:10 +0100 |
| commit | 0ae9fa303ff901309956e30d7029f93a485068f3 (patch) | |
| tree | 5e949c377fa2b9abedf3da750824bbb96824d403 | |
| parent | 245eecad314b2aef0a2e35c35043d0ef8adc4eed (diff) | |
| download | panfry-0ae9fa303ff901309956e30d7029f93a485068f3.tar.gz panfry-0ae9fa303ff901309956e30d7029f93a485068f3.tar.xz panfry-0ae9fa303ff901309956e30d7029f93a485068f3.zip | |
More regex fixes for the internal link processing
| -rwxr-xr-x | panfry/document.py | 4 |
1 files 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<s>[^\]^]+)\])\((?P<l>#[^\)]*)\)', re.S) - re_link2 = re.compile(r'(\[(?P<s>[^\]^]+)\][^(])', re.S) - re_link3 = re.compile(r'(\[(?P<s>[^\]^]+)\])\[(?P<h>[^\]].*)\]', re.S) + re_link2 = re.compile(r'(\[(?P<s>[^\]^]+)\])\[(?P<h>[^\]]*)\]', re.S) + re_link3 = re.compile(r'(\[(?P<s>[^\]^]+)\][^(])', 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) |
