diff --git a/in-note-text-tagging/in-note-text-tagging.qml b/in-note-text-tagging/in-note-text-tagging.qml index 84458cf..e4d9dcf 100644 --- a/in-note-text-tagging/in-note-text-tagging.qml +++ b/in-note-text-tagging/in-note-text-tagging.qml @@ -9,6 +9,7 @@ import QOwnNotesTypes 1.0 Script { property string tagMarker + property bool ignoreDoubleMarkers property bool putToBeginning property string tagHighlightColor @@ -20,6 +21,13 @@ Script { "type": "string", "default": "@", }, + { + "identifier": "ignoreDoubleMarkers", + "name": "Ignore repeated tag markers", + "description": "If enabled tags preceded by the same marker multiple times (such as @@no_tag) will be ignored.", + "type": "boolean", + "default": "false", + }, { "identifier": "putToBeginning", "name": "Put tags to beginning of note rather than to end", @@ -129,7 +137,10 @@ Script { // add the tag if it wasn't in the list if (tagNameList.indexOf(tagName) == -1) { - tagNameList.push(tagName); + // add the tag if it contains no duplicate tagMarkers or the check is disabled + if(ignoreDoubleMarkers == false || tagName.startsWith(escapeRegExp(tagMarker)) == false) { + tagNameList.push(tagName); + } } } return tagNameList;