Replies: 2 comments 7 replies
-
Have you checked w/ new remark (micromark)? I just checked YAML anywhere vs. setext, and this behavior makes sense to me and is I believe what you want: micromark/micromark-extension-frontmatter@5e86096 What is an example of thematic breaks interfering in a weird way? |
Beta Was this translation helpful? Give feedback.
-
I tried to implement a check in something like: function after(code) {
const token = effects.exit(name);
const yamlString = self.sliceSerialize(token);
if (!validYaml(yamlString)) {
return nok(code);
}
return ok(code);
} but it messes up the parser. a simple example: ---
- Foo
hello: 42
--- produces without the extension:
but with the extension:
It looks like the state is not reset properly, if the any ideas? |
Beta Was this translation helpful? Give feedback.
-
In Helix Pipeline we are processing documents that have YAML blocks in the middle of the document, as supported by the
anywhere
option in https://github.com/remarkjs/remark-frontmatterUnfortunately, this has lead us to experience a couple of scenarios where we had to resolve ambiguities between YAML fences, Setext headlines, and thematic breaks (see tests)with a number of custom constraints such as:
this has lead us down the path of building a custom remark plugin
Now with the switch to micromark, @tripodsan has started to re-implement our ambiguity-resolving constraints based on micromark-extension-frontmatter and co, but we wondered if it would be better to contribute it back to the official extension instead of keeping our separate fork.
As it stands, the
anywhere: true
andmarker: '-'
settings are practically incompatible, and implementing our heuristics within micromark-extension-frontmatter would either require additional configuration settings or callbacks or some other approach, but we'd like to get some feedback before we submit a big PR that may not be along the lines of your vision for the project.Beta Was this translation helpful? Give feedback.
All reactions