diff --git a/packages/happy-dom/src/html-parser/HTMLParser.ts b/packages/happy-dom/src/html-parser/HTMLParser.ts index 36f10957..e664d399 100755 --- a/packages/happy-dom/src/html-parser/HTMLParser.ts +++ b/packages/happy-dom/src/html-parser/HTMLParser.ts @@ -738,10 +738,8 @@ export default class HTMLParser { } // Plain text elements such as ', + 'text/html' + ) + )).body + ) + ).toBe('
'); + }); }); }); diff --git a/packages/happy-dom/test/xml-serializer/XMLSerializer.test.ts b/packages/happy-dom/test/xml-serializer/XMLSerializer.test.ts index a06b19c2..d62c79d6 100644 --- a/packages/happy-dom/test/xml-serializer/XMLSerializer.test.ts +++ b/packages/happy-dom/test/xml-serializer/XMLSerializer.test.ts @@ -456,5 +456,20 @@ describe('XMLSerializer', () => { ` ); }); + + it("Doesn't escape text in ', + 'text/html' + ) + )).body + ) + ).toBe( + '' + ); + }); }); });