When I insert a template, my YAML is modified. Even when the `Properties view` is disabled

Steps to reproduce

Just inserting a template, when you have an array in your YAML

Did you follow the troubleshooting guide? Y

Expected result

I expect nothing to happen except for the template text to be added.

Actual result

The array in the YAML is converted into a list.

Environment

SYSTEM INFO:
Obsidian version: v1.4.5
Installer version: v1.3.5
Operating system: Darwin Kernel Version 22.6.0
Login status: not logged in
Insider build toggle: off
Live preview: on
Legacy editor: off
Base theme: dark
Community theme: none
Snippets enabled: 0
Restricted mode: on

RECOMMENDATIONS:
none


Additional information

before

after

It depends on how you look at this issue. Both of those are semantically equivalent. The former is flow notation of YAML using JSON, the latter is “pure” YAML.

From YAML Ain’t Markup Language (YAML™) revision 1.2.2

YAML also has flow styles, using explicit indicators rather than indentation to denote scope. The flow sequence is written as a comma separated list within square brackets.

So aside from representation, no data was touched/modified.

2 Likes

I understand that both formats are valid, but please do not alter my data. I have already disabled the Properties view, but my data is still being modified, which disrupts my previous script, and it will be difficult for me to make bulk changes using VSCode + regex.

Alternatively, Obsidian can consider the following suggestions.
https://forum.obsidian.md/t/obsidian-can-recognize-aliases-and-tags-in-inline-fields/66641

Even if you have disabled properties view, still all YAML management done both by Obsidian and by the plugins is handled by the library we use.
The reasons for the way it acts are outlined here API: processFrontMatter removes string quotes, comments, types, formatting - #6 by Licat.

The properties view can be disabled, but still Obsidian and the plugins interact with the YAML via this parser.

Okay, I understand that I belong to the abandoned users. I’m not sure if this change in user data can still be considered ‘for you, forever.’

I think this may not align with “for you” because my note format is predefined and will be forcibly formatted.

I’m planning to use ‘Inline Fields’ instead of YAML. Can Obsidian fulfill the following request?
https://forum.obsidian.md/t/obsidian-can-recognize-aliases-and-tags-in-inline-fields/66641

1 Like

I merged it with the broader FR.

Use a semicolon to get round this?

---
aliases: It Is Raining on Santiago; Il pleut sur Santiago
---

I don’t think these two FRs are discussing the same thing. I just hope Obsidian can recognize aliases and tags in “Inline Fields” and won’t change their format arbitrarily. aliases and tags are the keys most likely to have multiple values added, and they will interact extensively with Obsidian.

Can you restore my FR, please?

1 Like

While this method may not be very elegant for aliases, it works. However, if the key is tags, this method becomes ineffective.

1 Like

I think what the two FRs are asking is the same. But if you feel like it isn’t. Open a new FR and make sure you follow the template.

@Nico I can see your frustration but the app is still “for you, forever”. You can simply roll back to an earlier version of the app and continue to use that one.

Another option, and the one I am going through, is to make changes to my files - slowly as I come to them - and move forward with the app as it grows and evolves.

Actually, this has set a bad precedent - give them an inch, and they’ll take a mile.

I know speaking up here won’t really make a difference, but scribbling something down is still better than playing the ostrich.

While ‘Properties’ may appear unattractive and intrusive to me personally, it is a necessary step for commercial viability and to better cater to habitual Notion users. As for the niche group that prefers batch processing, well, who cares? After all, who can resist the allure of large clients?

Don’t forget, you can batch process using any YAML library.

I do it through Node and js-yaml. Makes quick work of bulk updates, and I save the scripts in my vault so it’s all in one place.

Alright, maybe I didn’t explain it clearly, but the main issue here is that my content is silently altered without any warning. It could happen when I insert templates, merge files, or even in the future when I paste text.

Now, even when I insert a template with YAML into a blank document, my YAML often gets changed.

This leaves me with a profound sense of frustration. I mean, I might be able to deal with it, but why should I have to go through this extra work? I just don’t quite get it.

2 Likes

I completely get that - I’ve seen your various posts on it.

But the data is unchanged, only the layout, which is irrelevant if you use a YAML parser rather than modifying the plaintext.

Just an option, as for me the layout is immaterial, I only care about the data being reliable and accessible programmatically.

It’s also worth considering whether Obsidian is now the right solution, considering your specific need.

Have you ever looked at VSCode plus the various live markdown and Foam-like plugins? You can create a very similar all-open-source experience. I had a look at it a month or two ago and it was very decent.

I indeed don’t know how to use a YAML parser. Typically, I rely on VSCode and regex to make document modifications. Occasionally, I use Python to batch-create documents and initialize or split books. After all, I have tens of thousands of documents, and I can’t guarantee that my code is error-free. Using VSCode with a .gitignore setup gives me more confidence in my work.

If I wasn’t clear in the previous post, I meant that you could replace Obsidian entirely with VSCode and some plugins which provide very similar functionality.

Just an option to consider if the frontmatter changing is untenable.

Do you think I’m making this suggestion because it’s bad or too difficult to use? If that’s the case, I’d rather just move away from it and embrace other software, rather than spending my energy here.

If I offer a few suggestions to improve a dish that align more with my taste (FR) instead of demanding the chef to reveal their recipe (open-source), would the chef ask me to cook the dish myself and then judge my culinary skills?

This point is quite interesting.