How do I change how indentation is parsed? #856
-
I'm wanting to integrate remark / rehype with a component renderer, and something that happens often is that component rendering is deeply nested -- for example: <MyComponent>
<Foo>
<Bar>
- now I
- want a list
</Bar>
</Foo>
</MyComponent> but, because that list is indented 4+ spaces, it's interpreted as code. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
It looks like you want JSX and markdown mixed? If you want to go into custom parsing (I won't recommend it), you could use how micromark jsx is handled for MDX as a reference https://github.com/micromark/micromark-extension-mdx-jsx this is how it behaves https://codesandbox.io/s/mdx-2-component-block-parsing-p69f3 |
Beta Was this translation helpful? Give feedback.
It looks like you want JSX and markdown mixed?
If so, use consider using MDX directly. https://github.com/mdx-js/mdx
If you want to go into custom parsing (I won't recommend it), you could use how micromark jsx is handled for MDX as a reference https://github.com/micromark/micromark-extension-mdx-jsx
this is how it behaves https://codesandbox.io/s/mdx-2-component-block-parsing-p69f3