remarkjs / remark-directive

remark plugin to support directives
https://remark.js.org
MIT License
269 stars 17 forks source link

feature request: ability to nest directives #2

Closed yocontra closed 3 years ago

yocontra commented 3 years ago

Subject of the feature

Something like this:

:::box{flex}
  :::box
    ### Test h3
    Test content
  :::

  ::embed{url="http://example.com"}
:::

Problem

Currently container directives can't live inside of other container directives - the parser will close the parent container when it sees the first :::, and continue rendering the rest of the content as if it was not in the container.

Expected behavior

The parser should recognize when containers are nested and wait until the parent container is closed, instead of closing when it sees a child container close.

yocontra commented 3 years ago

Just noticed this repository doesn't actually contain the parser - moved the ticket here where the actual logic lives: https://github.com/micromark/micromark-extension-directive/issues/8