mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
Better error message for malformed wrap rules in Transform HTML
This commit is contained in:
parent
292e4c9da8
commit
cb1f70e816
@ -243,7 +243,10 @@ def empty(tag):
|
||||
|
||||
|
||||
def parse_start_tag(text):
|
||||
tag = parse(text, namespace_elements=True, fragment_context='div')[0]
|
||||
try:
|
||||
tag = parse(text, namespace_elements=True, fragment_context='div')[0]
|
||||
except IndexError as e:
|
||||
raise ValueError(_('No tag found in: {}. The tag specification must be of the form <tag> for example: <p>')) from e
|
||||
return {'tag': tag.tag, 'attrib': tag.items()}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user