linkedom icon indicating copy to clipboard operation
linkedom copied to clipboard

&quot converted to " on xml

Open nyanrus opened this issue 11 months ago • 3 comments

Thank you for good project! (2)

import { DOMParser } from "linkedom";

console.log(new DOMParser().parseFromString(`<html id="main-window" data-l10n-args="{&quot;content-title&quot;:&quot;CONTENTTITLE&quot;}"></html>`, "text/xml").toString());
console.log(new DOMParser().parseFromString(`<html id="main-window" data-l10n-args="{&quot;content-title&quot;:&quot;CONTENTTITLE&quot;}"></html>`, "text/html").toString());
❯ node test.js
<?xml version="1.0" encoding="utf-8"?><html id="main-window" data-
l10n-args="{"content-title":"CONTENTTITLE"}" />
<html id="main-window" data-l10n-args="{&quot;content-title&quot;:
&quot;CONTENTTITLE&quot;}"></html>

the &quot changed to ", and it occurs error in xml.

node v20.11.1 linkedom v0.16.10

nyanrus avatar Mar 23 '24 05:03 nyanrus