Handle unknown nodes in remark-rehype
mainBy default, remark-rehype handles unknown nodes (nodes not in handlers or passThrough) as follows:
- If the node has a
value(and lacksdata.hName,data.hProperties, ordata.hChildren), it creates ahasttextnode. - Otherwise, it creates a
<div>element (the tag name can be customized viadata.hName) with children mapped frommdasttohast.
You can override this behavior by providing an unknownHandler in the plugin options.