Replies: 1 comment
-
Thanks for reaching out @Jamie452! It could either be a bug in the original parser https://github.com/inikulin/parse5 or in translator for parse5 to hast https://github.com/syntax-tree/hast-util-from-parse5 |
Beta Was this translation helpful? Give feedback.
-
Our use case led us to use rehype to parse HTML, perform transformations, and then output back into HTML.
Rehype has worked great so far, but we've just tried inputting a custom HTML element, which has both
type
andvalue
attributes and are hitting the following error.Input:
<my-custom-tag type="some type" value="some value"></my-custom-tag>
Error:
Error: Cannot compile unknown node "some type"
I suspect the AST might rely on
type
+value
internally, and might be making an exception for handling these when they exist on built in elements such asinput
, which works fine (<input type="some type" value="some value"></input>
).I'm wondering if theres a way to specify how to handle these existing on custom elements?
I saw something which I think is somewhat related on the remark-rehype package, but we're not using markdown (https://github.com/remarkjs/remark-rehype#unknown-nodes).
Beta Was this translation helpful? Give feedback.
All reactions