Closed Bundas closed 4 years ago
This should work, could you provide an example of how you are doing all this?
@wooorm I was also checking if the input isn't somehow escaped but it is not so the problem is somewhere in the unified
tree
import markdown from 'remark-parse'
import raw from 'rehype-raw'
import remark2rehype from 'remark-rehype'
import rehype2react from 'rehype-react'
const processor = unified()
.use(markdown)
.use(remark2rehype, { allowDangerousHTML: true })
.use(raw)
.use(rehype2react, {
createElement: React.createElement,
})
{processor.processSync(original).contents}
Ah, the problem is that you’re missing an empty line between HTML and Markdown. See https://github.com/rehypejs/rehype-raw/issues/8 for more info.
If you want to enter markdown after block-level HTML again, you need that blank line. Without it, markdown parsers see it as one block of HTML.
Markdown after self-closing html tag is not parsed
When there is a self closing tag (eg.
<br/>
) before markdown content, the markdown is not parsed and is shown as is.Steps to reproduce
Example input:
Expected behaviour
Img + El VF 1000 / 65R32 CFO 200A8 HC3000R TL tiene un nuevo diseño de banda de rodadura
Actual behaviour
Img + El VF 1000 / 65R32 CFO 200A8 HC3000R TL tiene un **nuevo** diseño de banda de rodadura