aboutsummaryrefslogtreecommitdiffstats
path: root/markdown/preprocessors.py
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2010-03-25 13:50:13 -0400
committerWaylan Limberg <waylan@gmail.com>2010-03-25 13:50:13 -0400
commit1599e909fd5c7a80f51247d7232c7627693206e6 (patch)
tree13d0ad4279e7123c754ed7b807bed0b819a2bb43 /markdown/preprocessors.py
parent834f04b887c15017a2e08bb76f8a269d9ae074a2 (diff)
downloadmarkdown-1599e909fd5c7a80f51247d7232c7627693206e6.tar.gz
markdown-1599e909fd5c7a80f51247d7232c7627693206e6.tar.bz2
markdown-1599e909fd5c7a80f51247d7232c7627693206e6.zip
Fixed ticket 59. Reference links now strip angle brackets from the url.
Diffstat (limited to 'markdown/preprocessors.py')
-rw-r--r--markdown/preprocessors.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/markdown/preprocessors.py b/markdown/preprocessors.py
index b199f0a..3fabcf2 100644
--- a/markdown/preprocessors.py
+++ b/markdown/preprocessors.py
@@ -275,14 +275,15 @@ class ReferencePreprocessor(Preprocessor):
m = self.RE.match(line)
if m:
id = m.group(2).strip().lower()
+ link = m.group(3).lstrip('<').rstrip('>')
t = m.group(4).strip() # potential title
if not t:
- self.markdown.references[id] = (m.group(3), t)
+ self.markdown.references[id] = (link, t)
elif (len(t) >= 2
and (t[0] == t[-1] == "\""
or t[0] == t[-1] == "\'"
or (t[0] == "(" and t[-1] == ")") ) ):
- self.markdown.references[id] = (m.group(3), t[1:-1])
+ self.markdown.references[id] = (link, t[1:-1])
else:
new_text.append(line)
else: