Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions packages/happy-dom/test/html-parser/HTMLParser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2256,6 +2256,21 @@ describe('HTMLParser', () => {
`);
});

it('Handles numeric character references and ' in attribute values for #1947', () => {
const result = new HTMLParser(window).parse(`
<div>
<span data-foo="&#34;"></span>
<span data-foo="&#x22;"></span>
<span data-foo="&apos;"></span>
</div>`);
expect(new HTMLSerializer().serializeToString(result)).toBe(`
<div>
<span data-foo="&quot;"></span>
<span data-foo="&quot;"></span>
<span data-foo="'"></span>
</div>`);
});

it('Handles numeric character references in attribute values for #1947', () => {
// Decimal numeric character reference
const result1 = new HTMLParser(window).parse(`<div data-foo="&#34;"></div>`);
Expand Down