When using in-text-tagging plugin, double anchors are still detected as tags. #1

Closed
opened 2018-11-28 13:26:46 +00:00 by marty-oehme · 8 comments
marty-oehme commented 2018-11-28 13:26:46 +00:00 (Migrated from gitlab.com)

when a Zettel is anchored with §§{somenumber}, the intext tag plugin will still detect it as a tag and place it in the tag-tree.

when a Zettel is anchored with §§{somenumber}, the [intext tag plugin ](https://github.com/qownnotes/scripts/tree/23eaa68a3367704e1a1333c0a01d006aa372dacd/in-note-text-tagging) will still detect it as a tag and place it in the tag-tree.
marty-oehme commented 2018-11-28 13:35:25 +00:00 (Migrated from gitlab.com)

The solution hides in case "list" in the taggingHook, where an additional check for duplicate markers is necessary.

var duplicateRegExp = new RegExp("%1".arg(escapeRegExp(tagMarker)), "i");

while ((result = re.exec(noteText)) !== null) {
    tagName = result[1].replace(/_/g, " ");
    
    // add the tag if it wasn't in the list and it does not contain tagMarker duplicates
        if (tagNameList.indexOf(tagName) ==  -1 && duplicateRegExp.test(result[1]) == false) {
            tagNameList.push(tagName);
        }
}
return tagNameList;

There might be better ways? but it works

The solution hides in `case "list"` in the `taggingHook`, where an additional check for duplicate markers is necessary. ```javascript var duplicateRegExp = new RegExp("%1".arg(escapeRegExp(tagMarker)), "i"); while ((result = re.exec(noteText)) !== null) { tagName = result[1].replace(/_/g, " "); // add the tag if it wasn't in the list and it does not contain tagMarker duplicates if (tagNameList.indexOf(tagName) == -1 && duplicateRegExp.test(result[1]) == false) { tagNameList.push(tagName); } } return tagNameList; ``` There might be better ways? but it works
marty-oehme commented 2018-11-28 14:34:50 +00:00 (Migrated from gitlab.com)

Fixed here for now: f1f52efb68

Fixed here for now: https://github.com/marty-oehme/scripts/commit/f1f52efb685e25ad10508a1872814677092c773d
marty-oehme commented 2018-11-28 15:03:45 +00:00 (Migrated from gitlab.com)

closed

closed
marty-oehme commented 2018-11-28 16:49:24 +00:00 (Migrated from gitlab.com)

added 1 commit

Compare with previous version

added 1 commit <ul><li>01cce369 - Enable WikiStyle links</li></ul> [Compare with previous version](https://gitlab.com/marty.oehme/qown-zettelkasten/merge_requests/1/diffs?diff_id=28310511&start_sha=1bb44eeae0376bcfea641f3184c39be7cb691c5e)
marty-oehme commented 2018-11-28 16:56:16 +00:00 (Migrated from gitlab.com)

added 1 commit

Compare with previous version

added 1 commit <ul><li>6eee455c - Update README.md</li></ul> [Compare with previous version](https://gitlab.com/marty.oehme/qown-zettelkasten/merge_requests/1/diffs?diff_id=28312342&start_sha=01cce369ff82ab54d12dfb514780c1cb9850ab79)
marty-oehme commented 2018-11-28 16:56:48 +00:00 (Migrated from gitlab.com)

unmarked as a Work In Progress

unmarked as a **Work In Progress**
marty-oehme commented 2018-11-28 16:57:44 +00:00 (Migrated from gitlab.com)

merged

merged
marty-oehme commented 2018-11-28 16:57:51 +00:00 (Migrated from gitlab.com)

mentioned in commit 32c4c587d9

mentioned in commit 32c4c587d9a8a0fe08bd9d85ea29a5bd8987104d
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Marty/qown-zettelkasten#1
No description provided.