You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
instanceof Text broken in v6 — exported Text class differs from internal parser Text #2256
I'll take this. #2243 only resets the prototype for tag/script/style nodes, so instanceof Text (and Comment) still fail. I'll extend that same setPrototypeOf path to text/comment nodes and add a regression.
Activity
remarkablemark commentedon May 20, 2026
Are you using latest version? #2243 should fix this issue.
d4nzS commentedon May 21, 2026
I am using 6.1.1 but it doesn't work as expected
jramstedt commentedon May 21, 2026
I can verify that instanceof Text is still broken.
I have used this workaround:
remarkablemark commentedon May 21, 2026
Gotcha and just confirming, are your dependency versions consistent?
You should be using:
domhandler@6.0.1htmlparser2@12.0.0d4nzS commentedon May 21, 2026
Sure
MattIPv4 commentedon May 29, 2026
👋 We're also running into this on
html-react-parser@6.1.1, withdomhandler@6.0.1andhtmlparser2@12.0.0.ashwinmridul commentedon Sep 17, 2026
I'll take this. #2243 only resets the prototype for tag/script/style nodes, so
instanceof Text(and Comment) still fail. I'll extend that samesetPrototypeOfpath to text/comment nodes and add a regression.remarkablemark commentedon Sep 17, 2026
Thanks @ashwinmridul for the fix! Released:
Use Text guards for Show and Tell text nodes (#2515)