Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSDOM removes<template> content in xhtml #3672

Open
nyanrus opened this issue Jan 22, 2024 · 0 comments
Open

JSDOM removes<template> content in xhtml #3672

nyanrus opened this issue Jan 22, 2024 · 0 comments

Comments

@nyanrus
Copy link

nyanrus commented Jan 22, 2024

Basic info:

  • Node.js version: v20.11.0
  • jsdom version: v24.0.0

Minimal reproduction case

const { JSDOM } = require("jsdom");

//xhtml
console.log(
	new JSDOM(
		`<?xml version="1.0"?>
<html xmlns:html="http://www.w3.org/1999/xhtml">
  <body>
    <html:template>
    <div></div>
    </html:template>
  </body>
</html>`,
		{ contentType: "application/xhtml+xml" },
	).serialize(),
);
/* outputs
<html xmlns:html="http://www.w3.org/1999/xhtml">
  <body>
    <html:template></html:template>
  </body>
</html>
*/

How does similar code behave in browsers?

(Link to a jsbin or similar strongly suggested.)

in firefox,
image

@nyanrus nyanrus changed the title JSDOM removes<template> in xhtml JSDOM removes<template> content in xhtml Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant