Foam: Hash symbols in filenames or titles breaks Link References and Backlinks

Created on 13 Oct 2020  路  4Comments  路  Source: foambubble/foam

Describe the bug
I've started tagging my bubbles using tags, in the way that @picolino describes here: https://github.com/foambubble/foam/issues/34#issuecomment-703263753

However, I've notice a issues when using hash (#) symbols:

A/ When a file starts with an #, autocomplete doesn't work and it's impossible to create a proper Link Reference (it doesn't show up at the bottom of the file and does not create a link in preview mode).
B/ When a title starts with an #, Link Reference gets created properly, but no backlink will show up in the backlink section.

Affected package
I'm not sure if it's an issue with one of foam packages or with markdown-links.

To Reproduce
_Issue A /_

  • Create a #test.md file at root, which the following content :
# Test
I'm a test.
  • Try to link it from another bubble: [[Test]] or [[#test]]. Autocomplete won't work, Reference Link won't be created.
  • Rename the file to test.md
  • Try to link it from another bubble: [[Test]] or [[test]]. Autocomplete works and Reference Link is created.

_Issue B /_

  • Create a test2.md file at root, with the following content :
# #test2
I'm a test.
  • Link it from another bubble : [[#test2]]. Observe that the link is properly created.
  • Open test2.md and check the backlinks: there's none.
  • Remove the hash symbol from the title
  • Recreate the link: [[test2]]
  • Open test2.md and check the backlinks: there's one.

Expected behavior
Using Hash symbols should be possible in Titles and Filenames without breaking other functionality.

bug

All 4 comments

Just a little thought dump to get this moving...

This feels quite difficult to solve, because #something is a reference to a heading _within_ a page, not usually used in a filename. As a work around, is there an alternative qualifying character you could try, perhaps a tilde (~) to see if the problem persists even with that? That may at least confirm my thoughts...

Hey, thank you for your input !
I juste tested it and other special chars seems to break for me when at the beginning of the file name. Like my case A/ from the original post.

Autocompletion is there, but it does not create link references :
image

@clementoriol I am surprised that those chars don't work as I don't think they have special meaning in markdown, and I tested ~ before, might need to look into it

my suggestion in the meantime would be to use a tags/ directory (consider that to be a prefix, just like @ or ~).

Support for tags will be coming soon (#302)

closing this as we have added support for tags in #311

Was this page helpful?
0 / 5 - 0 ratings