Closed holgerbrandl closed 4 years ago
@holgerbrandl, the syntax means a reference link and it is not defined.
If you do not want these annotated then you can disable it which will disable it in all cases. If you want to keep validation but not make this a reference but plain text [DONE]
then you should escape the square bracket \[DONE]
.
To disable annotations for reference links:
@holgerbrandl, BTW markdowns specs are really given by the popular implementations but even in the case of CommonMark which has fairly well defined, testable specs, the language itself has no syntax errors. If it does not match any recognizable element then it is plain text. Including missing references used in reference links. This makes it a coin toss in deciding to highlight or not to highlight errors.
In your case it is an annoyance but if you had [TODOS]: http://...
defined but used [TODO]
in error then the error highlight would be appropriate.
I always escape unintended reference links to get rid off unintended errors because I rely on validation of references for reference links being defined. It is too easy to change or delete something and wind up with a dangling reference link/image without realizing it.
@holgerbrandl, just realized that this can be achieved using Link Map Reference mapping. It was intended to allow mapping of specific pattern matched references to actual URLs.
However, in this case you can just add DONE or any other pattern to the regex and map it to # which is a do nothing ref anchor in the plugin. It will remove the error highlight but will create a link in the preview.
BTW, why are you not using GitHub task lists for your TODO items.
They work nicely with structure view option Headings and Tasks
to organize, navigate and filter to do list items. This structure view option was inspired by your use case and I cannot live without it. It is my TODO organizer for markdown back log.
I will change link map to allow empty string for link text for Reference
so it eliminates the undefined reference annotation but will render as as if it was undefined for preview which just treats it as text.
Thanks for the pointer. I've extended your idea by simply using .*
as regex (because I honestly don't mind the errors in this case), and this works great as well.
@holgerbrandl, I should have thought of it sooner. Unfortunately, I tend to view the features with a filter for their intended use. It takes a while for me to see other use cases. Can't see the forest for the trees.
Next release the reference map text can be empty. In this case the reference will also not highlight as error and will render as plain text instead of a link.
Given Markdown's rather undefined specs, this should not be rendered as error imho or at least it would be nice to configure the reference resolver accordingly to disable to error.