Edit Book: Fix regression that caused crash while syntax highlighting CSS stylesheets that contain url() tokens without enclosing quotes

This commit is contained in:
Kovid Goyal 2014-07-11 16:12:24 +05:30
parent b2d4d55d63
commit 14431cee13

View File

@ -217,6 +217,7 @@ def content(state, text, i, formats, user_data):
m = token.match(text, i) m = token.match(text, i)
if m is not None: if m is not None:
if name is URL_TOKEN: if name is URL_TOKEN:
h = 'link'
url = m.group() url = m.group()
prefix, main, suffix = url[:4], url[4:-1], url[-1] prefix, main, suffix = url[:4], url[4:-1], url[-1]
if len(main) > 1 and main[0] in ('"', "'") and main[0] == main[-1]: if len(main) > 1 and main[0] in ('"', "'") and main[0] == main[-1]: