tulios / json-viewer

It is a Chrome extension for printing JSON and JSONP.
https://chrome.google.com/webstore/detail/json-viewer/gbmdgpbipfallnflgajpaliibnhdgobh
MIT License
3.36k stars 687 forks source link

Text node at the root of body tag in a html document is incorrectly wrapped in `<text>` #353

Open tom-sherman opened 6 months ago

tom-sherman commented 6 months ago

I originally raised this in https://github.com/vercel/next.js/issues/65985 as I thought it was a Next.js/React issue, but it's a bug in json-viewer it seems.

Steps to reproduce

Serve a html document with the content of <html><body>Hello world</body</html>. Make sure to include a Content-Type: text/html; charset=UTF-8 header.

Expected

HTML to be rendered with the exact content as above.

Actual

The text node is wrapped in <text>:

<html><body><text>Hello world</text></body</html>