From 5a5e63499ef1e64b919401d6ea12dc7f16ab1d0b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 19 Jul 2008 20:23:46 -0700 Subject: [PATCH] Fix bug in html2lrf that was causing problems with paragraghs inside tags. --- src/calibre/ebooks/lrf/html/convert_from.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/lrf/html/convert_from.py b/src/calibre/ebooks/lrf/html/convert_from.py index e602a61156..e1014d69dd 100644 --- a/src/calibre/ebooks/lrf/html/convert_from.py +++ b/src/calibre/ebooks/lrf/html/convert_from.py @@ -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('', '')), - # remove

tags from within tags - (re.compile(r'%(open)s(.*?)%(close)s'%tag_regex('a'), re.DOTALL|re.IGNORECASE), + # remove

tags from within 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