YAML fields issue

I have a collection that uses YAML headers (with no blank lines between the entries). This generally works fine (in terms of the fields being recognised by Notenik) but if a field’s longtext value closes with a blank line then - after the collection is refreshed - all fields below that new line are no longer recognised by Notenik and are shown as a long string as part of the body text. Side note: I am not knowingly adding the closing new line in the text field.

If i manually add a new line between all entries in the YAML section directly in my md files then Notenik once again recognises things correctly when i refresh the collection. However…

If i then make a change to a value in a note, save and refresh the collection, I find that Notenik has removed all of those blank lines in the YAML and the original issue returns.

My template file has spaces between the entries - not sure if that should affect things or not? It is the same template file as i shared here

This is causing me quite a few issues as it breaks all my mirrored files etc.

just to add a bit more to this…

Sometimes when Notenik reformats the YAML it adds a new --- where the new line was, resulting in that becoming the bottom of the YAML and not the next --- that is still in place but now part of the body.

It sounds like you are intentionally choosing YAML metadata instead of the Notenik format. Is this the case?

If so, then I’m wondering if you are successfully using the files with some other software as well?

To the best of my knowledge, YAML metadata was never really intended for use with what Notenik considers to be longtext fields: that is, YAML metadata fields were never intended to contain content formatted using Markdown.

So I’m wondering if you’re really doing yourself any favors by using YAML metadata.

the main favour is that it is a large batch of existing notes that i have. if i need to change the approach then i can but wasn’t aware of this shortcoming with YAML/Notenik.

The other advantage is that the metadata isn’t visible in the markdown preview/export of external editing apps.

Well, let me see what I might be able to do to accommodate…

if you can that would be great. otherwise i will switch to the notenik format as for this particular batch of notes i get way more out of what notenik can do than i can get elsewhere.

And just to double-check, when you look at your Collection settings, is the Preferred File Format set to YAML Frontmatter?

yes - it is set as YAML currently