Skip to content

Commit c25d628

Browse files
authored
Update hastscript
Closes GH-14. Closes syntax-tree/hast-util-from-html#8 Reviewed-by: Titus Wormer <[email protected]>
1 parent d33d275 commit c25d628

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"@types/hast": "^3.0.0",
3636
"@types/unist": "^3.0.0",
3737
"devlop": "^1.0.0",
38-
"hastscript": "^8.0.0",
38+
"hastscript": "^9.0.0",
3939
"property-information": "^6.0.0",
4040
"vfile": "^6.0.0",
4141
"vfile-location": "^5.0.0",

test/index.js

+28
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,34 @@ test('fromParse5', async function (t) {
245245
}
246246
)
247247
})
248+
249+
await t.test('should handle unknown attributes', async function () {
250+
assert.deepEqual(
251+
fromParse5(parseFragment('<button type="other" disabled>Hello</button>')),
252+
{
253+
type: 'root',
254+
children: [
255+
{
256+
type: 'element',
257+
tagName: 'button',
258+
properties: {
259+
type: 'other',
260+
disabled: true
261+
},
262+
children: [
263+
{
264+
type: 'text',
265+
value: 'Hello'
266+
}
267+
]
268+
}
269+
],
270+
data: {
271+
quirksMode: false
272+
}
273+
}
274+
)
275+
})
248276
})
249277

250278
test('fixtures', async function (t) {

0 commit comments

Comments
 (0)