Reputation: 1273
I have been happily using ReactMarkdown and I was wondering what is the easiest way to passthrough a whitelisted selection of HTML tags.
Let's use the kbd
element for now as an example. I have this markdown:
Please press key <kbd>CTRL</kbd>
For obvious safety reasons, ReactMarkdown escapes <kbd>
and </kbd>
and it does not render as kbd
HTML elements.
I know I can use the plugin rehype-raw, but is very large and I don't need to support the whole HTML: I would be happy with a compact yet brittle regexp-based implementation.
My understanding is that I have two options:
[kbd CTRL]
) and create a custom plugin that generates kdb
elementsIn concrete terms, my questions are:
Upvotes: 2
Views: 289