j-palindrome / obsidian-time-ruler

A drag-and-drop time ruler combining the best of a task list and a calendar view (integrates with Tasks, Full Calendar, and Dataview).
MIT License
214 stars 7 forks source link

Incorrect parsing of anchor links #107

Closed Sotis-Oph closed 5 months ago

Sotis-Oph commented 5 months ago

Describe the bug When processing a list of tasks containing anchor links, Time Ruler identifies part of the link as a tag. If you mark a task as completed, its description is distorted. A new tag appears and the link is broken. An example can be seen in the attached file and on the screenshot.

To Reproduce Steps to reproduce the behavior:

  1. Create a list of tasks with a anchor links. (Time Ruler does not show the description correctly)
  2. Mark the task as completed.

Expected behavior The system must correctly identify references as described in the documentation. https://help.obsidian.md/Linking+notes+and+files/Internal+links#Link+to+a+heading+in+a+note

Screenshots image

Test file Test.md

Obsidian Version:

Additional context I corrected the value of the regular expression TAG_SEARCH = /#[\p{Letter}\/\d_-]+/gu to TAG_SEARCH = /(?<!((\[[^(\])]*)|(\[[^\]]+\]\([^\)]*)))#[\p{Letter}\/\d_-]+/gu and the representation of the task in Time Ruler became correct. After the task execution the anchor link remained correct, but in the task description there was a new tag that should not be there. (#Description tag on the screenshot) image Maybe I'm missing something in the parser code...

j-palindrome commented 5 months ago

Thanks for pointing this out—I'll check. To be honest there's a bug in Dataview that recognizes anchor links as tags which complicates the matter. I'll fix in the upcoming release!