Can rehypeRemark passthrough all non standard html tags? #125
-
I'm using rehype-remark to convert some html into markdown but I need to keep custom html tags who I don't know in advance as they are. could be any non standard html tag and it's not known in advance. INPUT HTML WANTED OUTPUT MARKDOWN
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Welcome @giorgio-zamparelli! 👋 Some expectation setting before diving into things. Most likely you're trying to leverage another language like: JSX, Angular templates, Glimmer templates, etc. Back to your direct question:
Use a |
Beta Was this translation helpful? Give feedback.
Welcome @giorgio-zamparelli! 👋
Some expectation setting before diving into things.
Your example, does not contain custom HTML tags.
Custom elements must have a dash in their name (see https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements and https://html.spec.whatwg.org/#valid-custom-element-name)
<note>
is not a built in tag or a custom element, it is invalid HTML.Most likely you're trying to leverage another language like: JSX, Angular templates, Glimmer templates, etc.
If you need your content to be valid in a specific templating language, use a parser designed for that language.
HTML parsers will go into a recovery mode to try to handle this, which will re…