You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Yes
In Nuxt Content, I'm trying to add a Vue component with props in YAML format, but I'm encountering an issue with keys that contain a dot (.). Here’s an example of the YAML:
::comp---
foo.bar: 1
---
::
Currently, remark-mdc uses flat.unflatten in parseFrontMatter, which transforms parent.child keys into a nested structure, like this:
::comp---
foo:
bar: 1
---
::
While I understand that this feature is designed to support nested keys, in my case, I need to retain the dots in the original keys (e.g., foo.bar). Is it possible to introduce an escape character (e.g., foo\.bar) to prevent the transformation and preserve the key format?
Thanks for considering this feature!
Additional Infomation
Alternatively, another approach that may be more aligned with YAML's general behavior is to support explicit string keys. For example:
::comp
---
"foo.bar": 1
---
::
This would ensure that the key remains as a string and is not interpreted as a nested structure BUT it maybe hard to implement because need to customize to YAML parser / lexer.
The text was updated successfully, but these errors were encountered:
I just drafted a PR (#88) to implement escape for unflatten.
However, I need some assistance on stringifyFrontMatter and stringifyCodeBlockProps. Are any maintainers available to take a look? Your help would be greatly appreciated. Thanks!
Is your feature request related to a problem? Please describe.
Yes
In Nuxt Content, I'm trying to add a Vue component with props in YAML format, but I'm encountering an issue with keys that contain a dot (
.
). Here’s an example of the YAML:Currently,
remark-mdc
usesflat.unflatten
inparseFrontMatter
, which transformsparent.child
keys into a nested structure, like this:While I understand that this feature is designed to support nested keys, in my case, I need to retain the dots in the original keys (e.g.,
foo.bar
). Is it possible to introduce an escape character (e.g.,foo\.bar
) to prevent the transformation and preserve the key format?Thanks for considering this feature!
Additional Infomation
Alternatively, another approach that may be more aligned with YAML's general behavior is to support explicit string keys. For example:
This would ensure that the key remains as a string and is not interpreted as a nested structure BUT it maybe hard to implement because need to customize to YAML parser / lexer.
The text was updated successfully, but these errors were encountered: