Check book: Nicer handling of line offsets

Apparently some errors from the CSS checker library reference line
numbers, so rather than using an offset prepend extra newlines. Fixes #2009735 [Private bug](https://bugs.launchpad.net/calibre/+bug/2009735)
This commit is contained in:
Kovid Goyal 2023-03-09 17:34:34 +05:30
parent 491ee6ad98
commit e4e199e213
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -205,6 +205,9 @@ def create_job(name, css, line_offset=0, is_declaration=False, fix_data=None):
if is_declaration:
css = 'div{\n' + css + '\n}'
line_offset -= 1
if line_offset > 0:
css = ('\n' * line_offset) + css
line_offset = 0
return Job(name, css, line_offset, fix_data)