Handle empty arrays in frontmatter correctly (and not interchangeably with null)

Follow on from Obsidian changing empty array to null in Frontmatter.

Use case or problem

Obsidian treats empty arrays and null as the same. This causes problems when writing plugins that use an empty array to infer types. See the linked post for more details.

Proposed solution

Don’t rewrite empty arrays to be null in front matter

Current workaround (optional)

Only edit via custom plugin views that encode empty arrays as empty arrays.

Related feature requests (optional)

Obsidian changing empty array to null in Frontmatter.

1 Like

I’ve also noticed that if you remove the last element from a list that type remains an empty list (the desired behavior). This makes the behavior even less consistent!