markdown-to-jsx
markdown-to-jsx copied to clipboard
An option to disable MD parsing inside custom components
Hi!
I have a md code like:
<MyComponent>
[ ] one
[ ] two
</MyComponent>
I want those [ ] one to be used by MyComponent in some custom way. Unfortunately, they are handled by parser and turned to some predefined MD stuff early on.
Both overrides and createElement customizations are applied too late – I can customize rendering, but not parsing with them.
So I'm looking for an option to disable markdown parsing inside (at least) custom components.
There's an awkward workaround in the form of:
<MyComponent>
''' -- wrong quotes here just to render properly ;)
[ ] one
[ ] two
'''
</MyComponent>
which is honestly a big hack.
- It's quite verbose and inconvenient to use for content authors
- Requires
ReactDOMServer.renderToStringcalls on the client. Then I have to mess with<pre>and<code>wrappers to finally get my initial string 😨
Hmm, I'm open to it as a config option if you can keep the bundle size delta small.
same issue with codeblock,markdown to jsx will transfrom images in code block to real image
```

\`\`\`
but in common it will expected as:
<img src="./_assets/readme.md/MDinhuawei.com.png" width="200px" />
<!--or-->
<img src="./_assets/readme.md/MDinhuawei.com.png" style="height:200px" />