remark-mdc
remark-mdc copied to clipboard
Binding doc frontmatter in component frontmatter
Version
module: 3.0.2 nuxt: last
Reproduction
Link:
- [x] Stackblitz
- [x] GitHub reproduction
What is expected?
I want to bind value of the frontmatter doc in the frontmatter component.
---
title: The title
---
::alert
---
type:
- :nested: title
:type2: title
---
slot
::
What is actually happening?
First, it works only for root keys, not for nested keys. You can see the result on the repro.
The value of the key :type2
is well replaced by The title
, but not the :nested
value.
Second, there are 2 problems when we compile the AST to markdown :
- The binded root key
:type2
is replaced bytype2
. - The binded nested key
:nested
is single quoted to':nested'
. Starting a key with:
is valid in Yaml, it should not be quoted.
For the first problem, it seems it comes from this line, but if I comment this line, :type2
become single quoted.
Steps to reproduce
Launch vitest on my fork.
Additional information
Checklist
- [x] I have tested with the latest Nuxt version and the issue still occurs
- [x] I have tested with the latest module version and the issue still occurs
- [x] I have searched the issue tracker and this issue hasn't been reported yet
Steps to reproduce
What is expected?
- Permit binding nested value.
- Keep
:
of root bind value. - Don't use single quote as it's valid with Yaml.