Cleanup previous PR

This commit is contained in:
Kovid Goyal 2024-03-03 09:19:27 +05:30
parent 5517f188f4
commit d5360885ae
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 2 additions and 1 deletions

View File

@ -41,6 +41,7 @@ def expand_note_resources(root, get_resource):
if x:
img.set('src', data_url(guess_type(x['name'])[0], x['data']))
img.set('data-filename', x['name'])
return root
def import_note(shtml: str | bytes, basedir: str, add_resource) -> tuple[str, str, set[str]]:

View File

@ -2608,7 +2608,7 @@ class BuiltinGetNote(BuiltinFormatterFunction):
# Change the body to a div
root.tag = 'div'
# 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')
return note
except Exception as e: