foam
foam copied to clipboard
Wikilinks, Links and tags inside (inline) code blocks should be ignored
Describe the bug
If you define a inline-code '[[file2]]'
in file1.md, and unfortunately there is a file file2.md
in your repository, Foam will regard the inline-code as a link, and will appears in file2.md
's "backlink" interface, this fake-link also can be opened
To Reproduce
You can reproduce it by folling these steps:
- Create a file
file1.md
- Create a file
file2.md
- Type these words in
file1.md
:
`[[file2]]`
Expected behavior
'[[file2]]'
will be regarded as a link, and a backlink in file2.md
will appear in "backlink" interface
Screenshots
Supplement:
After posting this issue, I tested the code-block, the result is same with inline-code, and if file2.md
doesn't exist, Foam will create it.
I'm not sure if this is a bug or what you want, I mean, not "auto create file", but "inline-code
/code blocks
as a link". But what I can make sure is I can't open this fake-links in preview mode.
This is not currently managed by Foam itself, but https://github.com/kortina/vscode-markdown-notes. I am not sure whether the behavior is desired.
I agree that probably anything inside a code block or inline code block should not be included in the parsing of links/wikilinks (or tags for that matter, and I am pretty sure we currently include those).
I also ran into this bug when I was writing c++ in code blocks. I found that '#include' or '#define' or other macro in c/c++ were recognized as tag marks. It is quite annoying.
My c++ code block is shown below.
And my tag panel which was 'polluted' by c/c++ macro is shown below.
I just did some quick testing to see if this was still a problem. I'm unable to reproduce the issue now that backlinks and tags are handled by Foam itself. I believe this issue can be closed
Yup this has been fixed a long time ago and forgot to close the issue :)