Don't remove tags for the tag keyword (#2386)

This commit is contained in:
Veronica Berglyd Olsen
2025-06-06 19:16:59 +02:00
parent bf1067a346
commit 53355dbcc6
4 changed files with 17 additions and 12 deletions
+6 -4
View File
@@ -757,10 +757,12 @@ class Index:
"""Return all tags used by a specific document."""
return self._itemIndex.allItemTags(tHandle) if tHandle else []
def getClassTags(self, itemClass: nwItemClass | None) -> list[str]:
"""Return all tags based on itemClass."""
name = None if itemClass is None else itemClass.name
return self._tagsIndex.filterTagNames(name)
def getKeyWordTags(self, keyWord: str) -> list[str]:
"""Return all tags usable for a specific keyword."""
if keyWord in nwKeyWords.CAN_LOOKUP:
itemClass = nwKeyWords.KEY_CLASS.get(keyWord)
return self._tagsIndex.filterTagNames(itemClass.name if itemClass else None)
return []
def getTagsData(
self, activeOnly: bool = True