mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix bug in html2lrf that was causing problems with paragraghs inside <a> tags.
This commit is contained in:
parent
279a8e6067
commit
5a5e63499e
@ -92,8 +92,8 @@ class HTMLConverter(object, LoggingInterface):
|
||||
# sometimes there are unterminated comments
|
||||
(re.compile(r"<\s*style.*?>(.*?)<\/\s*style\s*>", re.DOTALL|re.IGNORECASE),
|
||||
lambda match: match.group().replace('<!--', '').replace('-->', '')),
|
||||
# remove <p> tags from within <a> tags
|
||||
(re.compile(r'%(open)s(.*?)%(close)s'%tag_regex('a'), re.DOTALL|re.IGNORECASE),
|
||||
# remove <p> tags from within <a href> tags
|
||||
(re.compile(r'<\s*a\s+[^<>]*href\s*=[^<>]*>(.*?)<\s*/\s*a\s*>', re.DOTALL|re.IGNORECASE),
|
||||
lambda match: re.compile(r'%(open)s|%(close)s'%tag_regex('p'), re.IGNORECASE).sub('', match.group())),
|
||||
|
||||
# Replace common line break patterns with line breaks
|
||||
|
Loading…
x
Reference in New Issue
Block a user