mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Cleanup previous PR
This commit is contained in:
parent
5517f188f4
commit
d5360885ae
@ -41,6 +41,7 @@ def expand_note_resources(root, get_resource):
|
|||||||
if x:
|
if x:
|
||||||
img.set('src', data_url(guess_type(x['name'])[0], x['data']))
|
img.set('src', data_url(guess_type(x['name'])[0], x['data']))
|
||||||
img.set('data-filename', x['name'])
|
img.set('data-filename', x['name'])
|
||||||
|
return root
|
||||||
|
|
||||||
|
|
||||||
def import_note(shtml: str | bytes, basedir: str, add_resource) -> tuple[str, str, set[str]]:
|
def import_note(shtml: str | bytes, basedir: str, add_resource) -> tuple[str, str, set[str]]:
|
||||||
|
@ -2608,7 +2608,7 @@ class BuiltinGetNote(BuiltinFormatterFunction):
|
|||||||
# Change the body to a div
|
# Change the body to a div
|
||||||
root.tag = 'div'
|
root.tag = 'div'
|
||||||
# Expand all the resources in the note
|
# Expand all the resources in the note
|
||||||
expand_note_resources(root, db.get_notes_resource)
|
root = expand_note_resources(root, db.get_notes_resource)
|
||||||
note = html.tostring(root, encoding='unicode')
|
note = html.tostring(root, encoding='unicode')
|
||||||
return note
|
return note
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user