arnau / obsidian-metatable

An Obsidian plugin to display the frontmatter section as a fully expanded table.
MIT License
150 stars 13 forks source link

Message: "Nested mappings are not allowed" #52

Closed badarotti closed 1 year ago

badarotti commented 1 year ago

Hi, Thanks for the great plugin. Seems like it will improve the quality of using Obsidian a great deal.

I'm getting the following error message on one of my notes:

Nested mappings are not allowed in compact mappings at line 4, column 9:

author: qBittorrent Development Team: https://github.com/qbittorrent
        ^

... from the following frontmatter:

created: 2023-06-30 - 19:50 
tags: 
url: https://www.qbittorrent.org/
author: qBittorrent Development Team: https://github.com/qbittorrent

The ^ seems to be pointing the letter number 9 q in the author attribute but I don't think that's the issue.

The problem seem to go away when I remove the colon in Team:, but I see the the colon is used no problem in other attributes.

Is this a bug or am I missing something?

Thanks

arnau commented 1 year ago

By the looks of it, you are missing some quotes. In YAML a value containing a reserved sequence such as : (notice space after : has to be "escaped" e.g. by adding quotes:

created: 2023-06-30 - 19:50 
tags: 
url: https://www.qbittorrent.org/
author: "qBittorrent Development Team: https://github.com/qbittorrent"

Hope this helps