Skip to content

Commit

Permalink
# 268
Browse files Browse the repository at this point in the history
  • Loading branch information
taoqf committed May 14, 2024
1 parent 3c297dc commit 4770f48
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion test/tests/issues/267.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { parse } = require('@test/test-target');

describe.only('issue 267', function () {
describe('issue 267', function () {
it('Incorrect Handling of Empty Class Attributes in SVG Parsing', function () {
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> `;
const root = parse(html);
Expand Down
34 changes: 34 additions & 0 deletions test/tests/issues/268.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
const { parse } = require('@test/test-target');

describe.skip('issue 268', function () {
it('Wrong output on malformed HTML', function () {
const html = `
<table id="mytable">
<tr class="myrow">
<td>1</td>
<td><a href="#" 2'>x</a></td>
<td>2</td>
</tr>
<tr class="myrow">
<td>3</td>
<td><a href="#" 2'>x</a></td>
<td>4</td>
</tr>
</table>`;
const root = parse(html);
root.querySelectorAll("#mytable tr.myrow").length.should.eql(2);
// for (let tr of root.querySelectorAll("#mytable tr.myrow")) {
// console.log('xxx',tr.querySelectorAll(":scope > td").map(e => e.innerText));
// }
});
it('xxx', function () {
const html = `<a href="#" 2'>x</a><a href="#" 2'>x</a>`;
const root = parse(html);
const a = root.querySelector("a");
console.error('sss',a.attributes);
a.toString().should.eql('<a href="#" 2">x</a>');
// for (let tr of root.querySelectorAll("#mytable tr.myrow")) {
// console.log('xxx',tr.querySelectorAll(":scope > td").map(e => e.innerText));
// }
});
});

0 comments on commit 4770f48

Please sign in to comment.