Don't save invalid keyword references to the index

This commit is contained in:
Veronica K. B. Olsen
2021-02-23 20:51:43 +01:00
parent a9d90da5c8
commit b7f27a2af0
+9 -1
View File
@@ -477,7 +477,15 @@ class NWIndex():
return False return False
sTitle = "T%06d" % nTitle sTitle = "T%06d" % nTitle
if sTitle in self._refIndex[tHandle] and theBits[0] != nwKeyWords.TAG_KEY: 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:]: for aVal in theBits[1:]:
self._refIndex[tHandle][sTitle]["tags"].append([nLine, theBits[0], aVal]) self._refIndex[tHandle][sTitle]["tags"].append([nLine, theBits[0], aVal])