sawhney17 / logseq-automatic-linker

MIT License
94 stars 17 forks source link

fix(markers): Preserve TODO markers when autolinking #75

Closed markscamilleri closed 5 months ago

markscamilleri commented 8 months ago

Problem

If I have a page that's titled the same as one of the TODO markers, which are defined as[^1]:

(defonce built-in-markers
  ["NOW" "LATER" "DOING" "DONE" "CANCELED" "CANCELLED" "IN-PROGRESS" "TODO" "WAIT" "WAITING"])

the plugin modifies the marker and places a link around that, such that given there exists a page "todo", for a to do item such as:

TODO This is a todo

the plugin transforms this to:

[[TODO]] This is a [[todo]]

which ruins the reason the marker is there in the first place (it was wrecking havoc with my queries too). [^1]: Taken from the logseq repository

Solution

Get the plugin to ignore markers at the start of a line. The above example now becomes:

TODO This is a [[todo]]
markscamilleri commented 5 months ago

Hi @sawhney17, sorry to bump this but this is an issue that I keep facing when using this plugin. I was wondering if we can get this fix merged in?

sawhney17 commented 5 months ago

Apologies for missing this. Nice approach for fixing it! Merging now :)

Thank you so much for this PR!