mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Conversion: Improve detection of input documents that use uppercase tag/attribute names. Fixes #1622261 [Private bug](https://bugs.launchpad.net/calibre/+bug/1622261)
This commit is contained in:
parent
df33ef6a3c
commit
b13b1ea5aa
@ -297,7 +297,7 @@ def parse_html(data, log=None, decoder=None, preprocessor=None,
|
||||
'HTML 5 parsing failed, falling back to older parsers')
|
||||
data = _html4_parse(data)
|
||||
|
||||
if has_html4_doctype or data.tag == 'HTML':
|
||||
if has_html4_doctype or data.tag == 'HTML' or (len(data) and (data[-1].get('LANG') or data[-1].get('DIR'))):
|
||||
# Lower case all tag and attribute names
|
||||
data.tag = data.tag.lower()
|
||||
for x in data.iterdescendants():
|
||||
|
Loading…
x
Reference in New Issue
Block a user