diff --git a/src/formats/standard_notes.py b/src/formats/standard_notes.py index 1f80f70..8a190f3 100644 --- a/src/formats/standard_notes.py +++ b/src/formats/standard_notes.py @@ -248,7 +248,7 @@ def convert(self, file_or_folder: Path): for item in input_json["items"]: if item["content_type"] != "Note" or item.get("deleted", False): continue - title = item["content"].get("title", common.unique_title()) + title = item["content"].get("title", common.unique_title()) self.logger.debug(f'Converting note "{title}"') note_imf = imf.Note( title, @@ -266,17 +266,9 @@ def convert(self, file_or_folder: Path): case "plain-text": note_imf.body = item["content"]["text"] case "super": - body = item["content"]["text"] - - if body: + if body := item["content"]["text"]: super_converter = SuperToMarkdown() - try: - note_imf.body = super_converter.convert(item["content"]["text"]) - except json.JSONDecodeError as e: - self.logger.warning( - f"Skipping Super Note '{title}' due to JSON parse error: {e}" - ) - continue + note_imf.body = super_converter.convert(body) else: note_imf.body = "" diff --git a/test/data b/test/data index e10753a..e2eb706 160000 --- a/test/data +++ b/test/data @@ -1 +1 @@ -Subproject commit e10753ae6da232018e878d292de13eb6e341575d +Subproject commit e2eb7064977ceba6ed51c489e00da0dd71eb63f7 diff --git a/test/test_convert.py b/test/test_convert.py index e805719..2117be0 100644 --- a/test/test_convert.py +++ b/test/test_convert.py @@ -137,6 +137,7 @@ def compare_dirs(dir1: Path, dir2: Path): [["standard_notes/test_1/Standard Notes - Sun Apr 28 2024 12_56_55.zip"]], [["standard_notes/test_2/Standard.Notes.-.super_format.GMT+0100.zip"]], [["standard_notes/test_3/backup.zip"]], + [["standard_notes/test_4/SN-Empty-SuperNote-Backup.zip"]], [["synology_note_station/test_1/20240331_144226_11102_Lagavulin.nsx"]], [["synology_note_station/test_2/20240409_202124_7594_Lagavulin.nsx"]], [["synology_note_station/test_3/notestation-test-books.nsx"]],