aboutsummaryrefslogtreecommitdiffstats
path: root/markdown/inlinepatterns.py
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2011-06-16 04:51:02 -0400
committerWaylan Limberg <waylan@gmail.com>2011-06-16 04:51:02 -0400
commit77d67a4d29a1c4e408a998d40017ef375d7450b8 (patch)
tree18fc61fa0aa20b5e96cbe0522fff4c27521f1093 /markdown/inlinepatterns.py
parentf6ab9657aa75d5fa503375ac88ac5f15f8c53b82 (diff)
downloadmarkdown-77d67a4d29a1c4e408a998d40017ef375d7450b8.tar.gz
markdown-77d67a4d29a1c4e408a998d40017ef375d7450b8.tar.bz2
markdown-77d67a4d29a1c4e408a998d40017ef375d7450b8.zip
Fixed #23. Turns out markdown.pl only allows up to one space between brackets in reference links. Now we do as well.
Diffstat (limited to 'markdown/inlinepatterns.py')
-rw-r--r--markdown/inlinepatterns.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/markdown/inlinepatterns.py b/markdown/inlinepatterns.py
index 0267482..35f0335 100644
--- a/markdown/inlinepatterns.py
+++ b/markdown/inlinepatterns.py
@@ -108,9 +108,9 @@ r'''\(\s*(<.*?>|((?:(?:\(.*?\))|[^\(\)]))*?)\s*((['"])(.*?)\12\s*)?\)'''
IMAGE_LINK_RE = r'\!' + BRK + r'\s*\((<.*?>|([^\)]*))\)'
# ![alttxt](http://x.com/) or ![alttxt](<http://x.com/>)
-REFERENCE_RE = NOIMG + BRK+ r'\s*\[([^\]]*)\]' # [Google][3]
+REFERENCE_RE = NOIMG + BRK+ r'\s?\[([^\]]*)\]' # [Google][3]
SHORT_REF_RE = NOIMG + r'\[([^\]]+)\]' # [Google]
-IMAGE_REFERENCE_RE = r'\!' + BRK + '\s*\[([^\]]*)\]' # ![alt text][2]
+IMAGE_REFERENCE_RE = r'\!' + BRK + '\s?\[([^\]]*)\]' # ![alt text][2]
NOT_STRONG_RE = r'((^| )(\*|_)( |$))' # stand-alone * or _
AUTOLINK_RE = r'<((?:f|ht)tps?://[^>]*)>' # <http://www.123.com>
AUTOMAIL_RE = r'<([^> \!]*@[^> ]*)>' # <me@example.com>