From d251ebb9951a51903ee1d55e5a2c5b251804aac2 Mon Sep 17 00:00:00 2001 From: "Veronica B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Mon, 22 Feb 2021 09:13:52 +0100 Subject: [PATCH 1/2] Fix typo in changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 38bfe7508..e0eb39f70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -225,7 +225,7 @@ _These Release Notes also include the changes from 1.1 RC 1._ **Bugfixes** * A `None` check in the details panel below the project tree was missing, resulting in an - occasional error message being printed to the logging output. The error was otherwise handles, so + occasional error message being printed to the logging output. The error was otherwise handled, so this is mainly a fix to prevent the error message. PR #639. **User Interface** From b7f27a2af0ea254c3e5f696e24c510fc65e9a4c6 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Tue, 23 Feb 2021 20:51:43 +0100 Subject: [PATCH 2/2] Don't save invalid keyword references to the index --- nw/core/index.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/nw/core/index.py b/nw/core/index.py index 73d469c40..0932b34a8 100644 --- a/nw/core/index.py +++ b/nw/core/index.py @@ -477,9 +477,17 @@ def _indexNoteRef(self, tHandle, aLine, nLine, nTitle): return False sTitle = "T%06d" % nTitle - if sTitle in self._refIndex[tHandle] and theBits[0] != nwKeyWords.TAG_KEY: - for aVal in theBits[1:]: - self._refIndex[tHandle][sTitle]["tags"].append([nLine, theBits[0], aVal]) + if sTitle not in self._refIndex[tHandle]: + return False + + if theBits[0] == nwKeyWords.TAG_KEY: + return False + + if theBits[0] not in nwKeyWords.VALID_KEYS: + return False + + for aVal in theBits[1:]: + self._refIndex[tHandle][sTitle]["tags"].append([nLine, theBits[0], aVal]) return True