From 00837f1da49c333cbe292469c60d8865f2b6e5c7 Mon Sep 17 00:00:00 2001 From: Abdelraoof Hosam Date: Sun, 3 Aug 2025 07:19:31 +0300 Subject: [PATCH] New line when adding context to cards --- src/note.ts | 4 ++-- tests/anki/test_context_test.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/note.ts b/src/note.ts index 17330c31..1b7475a5 100644 --- a/src/note.ts +++ b/src/note.ts @@ -95,7 +95,7 @@ abstract class AbstractNote { } if (context) { const context_field = data.context_fields[this.note_type] - template["fields"][context_field] += context + template["fields"][context_field] += '
' + context } if (data.add_obs_tags) { for (let key in template["fields"]) { @@ -297,7 +297,7 @@ export class RegexNote { } if (context) { const context_field = data.context_fields[this.note_type] - template["fields"][context_field] += context + template["fields"][context_field] += '
' + context } if (this.note_type.includes("Cloze") && !(note_has_clozes(template))) { this.identifier = CLOZE_ERROR //An error code that says "don't add this note!" diff --git a/tests/anki/test_context_test.py b/tests/anki/test_context_test.py index 02b99ab7..99da0b8c 100644 --- a/tests/anki/test_context_test.py +++ b/tests/anki/test_context_test.py @@ -49,6 +49,6 @@ def test_cards_front_back_tag_type(col: Collection): note1 = col.get_note(anki_IDs[0]) assert note1.fields[0] == "This is a test" - assert note1.fields[1] == "Test successful!context_test/context_test.md > Overall point > Subheading 2" + assert note1.fields[1] == "Test successful!
context_test/context_test.md > Overall point > Subheading 2" assert note1.note_type()["name"] == "Basic" \ No newline at end of file