Closed therealbnut closed 3 months ago
Great catch, will fix!
@esm7 thank you very much ❤️! Also, if you don’t mind my asking, I’m interested to know how come you use tag:
instead of #
in the inline tags? It seems like #
would be much better supported, but I’m sure there’s a reason it’s not used.
The reason is that using #
is interpreted by Obsidian as a tag that belongs to the whole note, regardless of what line it is at, and we don't want that happening for "inline" tags.
Added as part of the just-released 5.0.0.
Hi,
Thanks for making this plugin, it's a large part of why I'm using Obsidian!
I've been having issues with tags, and it turns out that my issue was that you need a tag defined at a file level to be able to query it, even if the tag is defined inline (
[](geo:...) tag:inline
).If you do something like this:
The query filter will not suggest any of these tags, you can't type it manually either. As far as I can tell, this is because obsidian itself doesn't know these are tags.
This also doesn't work:
because map view applies those tags to every marker in the file. It also has duplicate entries of
#place
in the query suggestions. This otherwise appears to be the equivalent of this:The only workaround I've found at the moment, is to make a new file like this:
Which works, but there's a lot of redundancy it'd be nice to avoid.
I would love to be able to use the
#
syntax inline rather thantag:
. I think it would be more intuitive. If that's not possible for some technical/conventional reason it would be great for Map View to find inline tags without them having to be tags Obsidian is aware of (#
). Either way it seems like there has to be some tag redundancy to make obsidian aware of it if you usetag:
, so it doesn't seem ideal.I've had a look at the code, and I think the issue might be because this doesn't find inline tags: https://github.com/esm7/obsidian-map-view/blob/2b3be819067c2e2dd85418f61f8bd9a4f126ba7b/src/utils.ts#L272-L286
Unrealated, I think it would be much faster using a
Set
instead of an array, something like this:I'm sorry, I had a look, but I don't know enough about javascript typescript or obsidian to suggest how to fix my issue. It probably depends heavily on your reasons for the current syntax anyway.
It's possible that all uses of
obsidian.getAllTags
have a similar issue, and you might need to look at them too. I tried repurposing code fromgetMarkersFromFileContent
ingetAllTagNames
, but I couldn't get it to work.Thanks for reading this!