mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-29 22:13:15 +02:00
Apply #234 thanks wayne
This commit is contained in:
parent
03ce2c2a61
commit
9cbe71c384
1 changed files with 3 additions and 3 deletions
|
|
@ -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…
Reference in a new issue