diff --git a/src/calibre/db/notes/exim.py b/src/calibre/db/notes/exim.py index 6c3db1bd0e..c55854b536 100644 --- a/src/calibre/db/notes/exim.py +++ b/src/calibre/db/notes/exim.py @@ -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]]: diff --git a/src/calibre/utils/formatter_functions.py b/src/calibre/utils/formatter_functions.py index 85254bfe35..bbe9c3a56e 100644 --- a/src/calibre/utils/formatter_functions.py +++ b/src/calibre/utils/formatter_functions.py @@ -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: