The problem with tags in YAML

The documentation says

Front matter is a YAML block with triple dashes both before and after. It also needs to be placed at the very top of the file.

But if I write tags at the beginning, they don’t work (Example from the forum).

---
tags:
  - #Uni/Assessment
  - #Uni 
---

But if I insert text in front of this block, the tags will appear in the list.

aaaa
---
tags:
  - #Uni/Assessment
  - #Uni 
---


A very strange contradiction. How to do it right?

you will have to put the tags inside quotes. for example- “#tag1” or ‘#tag1’.

Although I am not 100% sure but I don’t think that it is a bug. It is just that YAML works like this

But if I put quotation marks then the # prompt doesn’t work. Another bug.
"#(no tips)

I’m talking about that.

I tried doing the above and yes there are no prompts while trying to add tags in the metadata. However it is also the same inside the body. So i guess it is less of a bug and has got more to do with syntax.

1 Like

Just don’t use # in the YAML—it means comment starts here.

These should both work:

---
tags: [Uni/Assessment, Uni]
---

# Rest of the note

or

---
tags:
  - Uni/Assessment
  - Uni
---

# Rest of the note
3 Likes

Ok, I’m using tags a lot and I’m looking for a way to type them quickly. If I do not use #, I can very easily make mistakes when typing.
For example, in TiddlyWiki I can quickly select ready-made tags and not have to worry about remembering their names every time.
Therefore, I am waiting for the system to allow me to do this, instead of constantly typing with my own hands.

It probably won’t. YAML is what YAML is.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.