mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Apply #234 thanks wayne
This commit is contained in:
parent
03ce2c2a61
commit
9cbe71c384
@ -60,8 +60,8 @@ class HTMLConverter(object):
|
||||
|
||||
MARKUP_MASSAGE = [
|
||||
# Close <a /> tags
|
||||
(re.compile("(<a\s+.*?)/>|<a/>", re.IGNORECASE),
|
||||
lambda match: match.group(1)+"></a>"),
|
||||
(re.compile(r'<a(\s[^>]*)?/>', re.IGNORECASE),
|
||||
lambda match: '<a'+match.group(1)+'></a>'),
|
||||
# Strip comments from <style> tags. This is needed as
|
||||
# sometimes there are unterminated comments
|
||||
(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
|
||||
else match.group(1)),
|
||||
# Remove hyphenation
|
||||
(re.compile(r'-\n|-\n\r'), lambda match: ''),
|
||||
(re.compile(r'-\n\r?'), lambda match: ''),
|
||||
|
||||
]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user