From e1c97f78c3d71fb696089cf35421b8e102268dd9 Mon Sep 17 00:00:00 2001 From: kulst <60887784+kulst@users.noreply.github.com> Date: Sat, 22 Nov 2025 18:16:33 +0100 Subject: [PATCH] fix: make the -u option keep content before first '# Note' --- src/apyanki/anki.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/apyanki/anki.py b/src/apyanki/anki.py index 23f1241..f15c314 100644 --- a/src/apyanki/anki.py +++ b/src/apyanki/anki.py @@ -598,6 +598,8 @@ def _update_file_with_note_ids( # Extract each note's section and check if it needs to be updated updated_content: list[str] = [] + # Keep content before first '# Note' + updated_content.append(content[0 : note_positions[0]]) for i in range(len(note_positions) - 1): start = note_positions[i] end = note_positions[i + 1]