Closed kkharji closed 3 years ago
I'm not sure what did you mean by injecting yaml, but according to Multi-language Documents, there should be a front-matter
language to be used for extracting the yaml
part and the markdown
part, and those extracted parts should be passed to the corresponding language to get the final tree then.
Hey @ikatyang I meant more as a simple identification because the syntax tree of ---\frontmatter--/ is wrong.
I'll look into multiple languages, i'm getting started with treesitter, feel free to close the issue if it doesn't make sense to identify frontmatter block like code_block
the syntax tree of ---\frontmatter--/ is wrong.
That's the expected syntax tree for parsers that follow CommonMark/GFM spec strictly, front matter is not part of the spec but an common extension to the Markdown language, and as far as I can tell there is no spec for how to parse it, its grammar is all up to the implementer.
feel free to close the issue if it doesn't make sense to identify frontmatter block like code_block
Since front matter is not part of the spec and it could also be used in other languages such as HTML, I think it'd be better to use a front-matter
language to achieve this goal. I'm going to close this issue but feel free to comment if you have further questions.
Hey @ikatyang,
Is it possible to support identification of front-matter block. I'd like to inject yaml to it like
Currently I'm getting for
=
Thanks