jmilldotdev / obsidian-frontmatter-tag-suggest

Autocompletes tags in Obsidian YAML frontmatter. No more deleting #!
MIT License
111 stars 6 forks source link

Multiline tags should have two spaces before the hyphen #15

Open Calorion opened 2 years ago

Calorion commented 2 years ago

As shown at https://help.obsidian.md/How+to/Working+with+tags, YAML multiline tags should have two spaces before the hyphen, not one as this plugin uses.

Thanks for a very helpful plugin!

bdrewery commented 2 years ago

When combing this plugin with https://github.com/platers/obsidian-linter it gets into a situation where both plugins are fighting. It puts 2 spaces, this puts 1 space, the linter hits an error.

It looks like it is a trivial fix to https://github.com/jmilldotdev/obsidian-frontmatter-tag-suggest/pull/6/files#diff-564c860307257bfac9176f554a35aa858c350a59d75c0dcd0a5d63a480805bd0R92

The fix would conflict with https://github.com/jmilldotdev/obsidian-frontmatter-tag-suggest/pull/8 (which does not fix this specific problem).

You can modify .obsidian/plugins/obsidian-frontmatter-tag-suggest/main.js to fix the problem locally. Just find the line near the end starting with -.

macdrifter commented 1 year ago

I don't have a good argument one way or another but it does seem like there is a conflict within the Obsidian spec. The more generic definition for YAML front matter shows that no spaces should precede the first bulleted field values: https://help.obsidian.md/Advanced+topics/YAML+front+matter

Unless tags are a very special kind of YAML property in Obsidian then I think it should follow the more generic specification.

I think I prefer to have no spaces before the dash to avoid confusion while visually inspecting a list (one vs. two spaces is harder to discern than no spaces).

[EDIT]: Looking at the YAML specification it seems that any of these is acceptable

HighLibrarian commented 1 year ago

@Calorion, on line 124 in main.js i just added an extra space before the -'; and that seems to add the extra space.