mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Edit book: Fix check book failling in the presence of empty <style/> tags. Fixes #1292841 [Edit book / check crashes on empty inline style tag](https://bugs.launchpad.net/calibre/+bug/1292841)
This commit is contained in:
parent
5864635e4a
commit
6d60befc70
@ -50,7 +50,7 @@ def run_checks(container):
|
|||||||
for name, mt, raw in html_items:
|
for name, mt, raw in html_items:
|
||||||
root = container.parsed(name)
|
root = container.parsed(name)
|
||||||
for style in root.xpath('//*[local-name()="style"]'):
|
for style in root.xpath('//*[local-name()="style"]'):
|
||||||
if style.get('type', 'text/css') == 'text/css':
|
if style.get('type', 'text/css') == 'text/css' and style.text:
|
||||||
errors.extend(check_css_parsing(name, style.text, line_offset=style.sourceline - 1))
|
errors.extend(check_css_parsing(name, style.text, line_offset=style.sourceline - 1))
|
||||||
for elem in root.xpath('//*[@style]'):
|
for elem in root.xpath('//*[@style]'):
|
||||||
raw = elem.get('style')
|
raw = elem.get('style')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user