@@ -147,13 +147,13 @@ def build_inlinepatterns(md, **kwargs):
147
147
NOT_STRONG_RE = r'((^|\s)(\*|_)(\s|$))'
148
148
149
149
# <http://www.123.com>
150
- AUTOLINK_RE = r'<((?:[Ff]|[Hh][Tt])[Tt][Pp][Ss]?://[^>]*)>'
150
+ AUTOLINK_RE = r'<((?:[Ff]|[Hh][Tt])[Tt][Pp][Ss]?://[^< >]*)>'
151
151
152
152
153
- AUTOMAIL_RE = r'<([^> \ !]*@[^> ]*)>'
153
+ AUTOMAIL_RE = r'<([^<> !]*@[^@< > ]*)>'
154
154
155
155
# <...>
156
- HTML_RE = r'(\ <([a-zA-Z/][^\ >]*?|\ !--.*? --)\ >)'
156
+ HTML_RE = r'(<([a-zA-Z/][^< >]*| !--[^<>]* --)>)'
157
157
158
158
# "&" (decimal) or "&" (hex) or "&" (named)
159
159
ENTITY_RE = r'(&(?:\#[0-9]+|\#x[0-9a-fA-F]+|[a-zA-Z0-9]+);)'
@@ -433,7 +433,7 @@ def get_stash(m):
433
433
434
434
class LinkInlineProcessor (InlineProcessor ):
435
435
""" Return a link element from the given match. """
436
- RE_LINK = re .compile (r'''\(\s*(?:(<.*? >)\s*(?:(['"])(.*?)\2 \s*)?\))?''' , re .DOTALL | re .UNICODE )
436
+ RE_LINK = re .compile (r'''\(\s*(?:(<[^<>]* >)\s*(?:('[^']*'|"[^"]*") \s*)?\))?''' , re .DOTALL | re .UNICODE )
437
437
RE_TITLE_CLEAN = re .compile (r'\s' )
438
438
439
439
def handleMatch (self , m , data ):
@@ -467,8 +467,8 @@ def getLink(self, data, index):
467
467
if m and m .group (1 ):
468
468
# Matches [Text](<link> "title")
469
469
href = m .group (1 )[1 :- 1 ].strip ()
470
- if m .group (3 ):
471
- title = m .group (3 )
470
+ if m .group (2 ):
471
+ title = m .group (2 )[ 1 : - 1 ]
472
472
index = m .end (0 )
473
473
handled = True
474
474
elif m :
0 commit comments