Closed remcohaszing closed 5 months ago
Weird. It seems to be the camelcase.
If I pass any other lowercase string (even lineargradient
) through, it nests adjacently fine.
And the weird thing with lineargradient
: if I pass that in, I get linearGradient
out!
My guess for what’s going on is that the HTML parser is case-insensitive for tag names. So, parse5 lowercases things. When we here pass a cased string in, most things go fine, but when doing the closing tag, it doesn’t match up to the current open tag, and is thus discarded.
Hi! This was closed. Team: If this was fixed, please add phase/solved
. Otherwise, please add one of the no/*
labels.
Initial checklist
Affected packages and versions
hast-util-raw@9.0.2
Link to runnable example
No response
Steps to reproduce
Fun the following script:
This causes https://github.com/remcohaszing/rehype-mermaid/issues/17
Expected behavior
It logs:
Actual behavior
It moves all siblings after
linearGradient
inside its children.Affected runtime and version
node@22.1.0
Affected package manager and version
npm@10.7.0
Affected OS and version
Pop!_OS 22.04
Build and bundle tools
No response