Apply #234 thanks wayne

This commit is contained in:
Kovid Goyal 2007-10-09 05:22:20 +00:00
parent 03ce2c2a61
commit 9cbe71c384

View File

@ -60,8 +60,8 @@ class HTMLConverter(object):
MARKUP_MASSAGE = [ MARKUP_MASSAGE = [
# Close <a /> tags # Close <a /> tags
(re.compile("(<a\s+.*?)/>|<a/>", re.IGNORECASE), (re.compile(r'<a(\s[^>]*)?/>', re.IGNORECASE),
lambda match: match.group(1)+"></a>"), lambda match: '<a'+match.group(1)+'></a>'),
# Strip comments from <style> tags. This is needed as # Strip comments from <style> tags. This is needed as
# sometimes there are unterminated comments # sometimes there are unterminated comments
(re.compile(r"<\s*style.*?>(.*?)<\/\s*style\s*>", re.DOTALL|re.IGNORECASE), (re.compile(r"<\s*style.*?>(.*?)<\/\s*style\s*>", re.DOTALL|re.IGNORECASE),
@ -91,7 +91,7 @@ class HTMLConverter(object):
lambda match: match.group() if re.match('<', match.group(1).lstrip()) or len(match.group(1)) < 40 lambda match: match.group() if re.match('<', match.group(1).lstrip()) or len(match.group(1)) < 40
else match.group(1)), else match.group(1)),
# Remove hyphenation # Remove hyphenation
(re.compile(r'-\n|-\n\r'), lambda match: ''), (re.compile(r'-\n\r?'), lambda match: ''),
] ]