diff --git a/src/calibre/ebooks/lrf/html/convert_from.py b/src/calibre/ebooks/lrf/html/convert_from.py index b301854684..ab8550bd5e 100644 --- a/src/calibre/ebooks/lrf/html/convert_from.py +++ b/src/calibre/ebooks/lrf/html/convert_from.py @@ -109,6 +109,10 @@ class HTMLConverter(object, LoggingInterface): # Remove self closing script tags as they also mess up BeautifulSoup (re.compile(r'(?i)]+?/>'), lambda match: ''), + # BeautifulSoup treats self closing
tags as open
tags + (re.compile(r'(?i)<\s*div([^>]*)/\s*>'), + lambda match: '
'%match.group(1)) + ] # Fix Baen markup BAEN = [