From 8f2f0161b2af92f8dd25a0a55cb7d437a67938bc Mon Sep 17 00:00:00 2001 From: Mi Yu Date: Mon, 25 Jun 2018 09:10:19 -0400 Subject: [PATCH] fixed: trailing characters after reference definition --- mistletoe/block_token.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/mistletoe/block_token.py b/mistletoe/block_token.py index 8dcc2166..0a4c2c0e 100644 --- a/mistletoe/block_token.py +++ b/mistletoe/block_token.py @@ -819,15 +819,17 @@ def match_link_title(cls, string, offset): or '\n' in string[offset:new_offset] and string[new_offset] == '['): return offset, new_offset, '' - offset = new_offset - if string[offset] == '"': + if string[new_offset] == '"': closing = '"' - elif string[offset] == "'": + elif string[new_offset] == "'": closing = "'" - elif string[offset] == '(': + elif string[new_offset] == '(': closing = ')' - else: + elif '\n' in string[offset:new_offset]: return offset, offset, '' + else: + return None + offset = new_offset escaped = False for i, c in enumerate(string[offset+1:], start=offset+1): if c == '\\' and not escaped: