Skip to content

Commit

Permalink
Update hastscript
Browse files Browse the repository at this point in the history
Closes GH-14.
Closes syntax-tree/hast-util-from-html#8

Reviewed-by: Titus Wormer <tituswormer@gmail.com>
  • Loading branch information
albinekb authored Nov 19, 2024
1 parent d33d275 commit c25d628
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@types/hast": "^3.0.0",
"@types/unist": "^3.0.0",
"devlop": "^1.0.0",
"hastscript": "^8.0.0",
"hastscript": "^9.0.0",
"property-information": "^6.0.0",
"vfile": "^6.0.0",
"vfile-location": "^5.0.0",
Expand Down
28 changes: 28 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,34 @@ test('fromParse5', async function (t) {
}
)
})

await t.test('should handle unknown attributes', async function () {
assert.deepEqual(
fromParse5(parseFragment('<button type="other" disabled>Hello</button>')),
{
type: 'root',
children: [
{
type: 'element',
tagName: 'button',
properties: {
type: 'other',
disabled: true
},
children: [
{
type: 'text',
value: 'Hello'
}
]
}
],
data: {
quirksMode: false
}
}
)
})
})

test('fixtures', async function (t) {
Expand Down

0 comments on commit c25d628

Please sign in to comment.