Skip to content

Commit 4770f48

Browse files
committed
# 268
1 parent 3c297dc commit 4770f48

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

test/tests/issues/267.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const { parse } = require('@test/test-target');
22

3-
describe.only('issue 267', function () {
3+
describe('issue 267', function () {
44
it('Incorrect Handling of Empty Class Attributes in SVG Parsing', function () {
55
const html = `<polygon points="-235.18 1571.95 1014.73 1284.4 1083.46 1590.1 -166.45 1877.65 -235.18 1571.95" fill="#ff8200" class="" design-color="primary"></polygon> `;
66
const root = parse(html);

test/tests/issues/268.js

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
const { parse } = require('@test/test-target');
2+
3+
describe.skip('issue 268', function () {
4+
it('Wrong output on malformed HTML', function () {
5+
const html = `
6+
<table id="mytable">
7+
<tr class="myrow">
8+
<td>1</td>
9+
<td><a href="#" 2'>x</a></td>
10+
<td>2</td>
11+
</tr>
12+
<tr class="myrow">
13+
<td>3</td>
14+
<td><a href="#" 2'>x</a></td>
15+
<td>4</td>
16+
</tr>
17+
</table>`;
18+
const root = parse(html);
19+
root.querySelectorAll("#mytable tr.myrow").length.should.eql(2);
20+
// for (let tr of root.querySelectorAll("#mytable tr.myrow")) {
21+
// console.log('xxx',tr.querySelectorAll(":scope > td").map(e => e.innerText));
22+
// }
23+
});
24+
it('xxx', function () {
25+
const html = `<a href="#" 2'>x</a><a href="#" 2'>x</a>`;
26+
const root = parse(html);
27+
const a = root.querySelector("a");
28+
console.error('sss',a.attributes);
29+
a.toString().should.eql('<a href="#" 2">x</a>');
30+
// for (let tr of root.querySelectorAll("#mytable tr.myrow")) {
31+
// console.log('xxx',tr.querySelectorAll(":scope > td").map(e => e.innerText));
32+
// }
33+
});
34+
});

0 commit comments

Comments
 (0)