permit data- prefix on script attributes

fixes #109
This commit is contained in:
Jeremy Danyow 2019-01-27 15:26:04 -08:00
parent a866ca8774
commit 630e3d9553
No known key found for this signature in database
GPG Key ID: 50404A1CEB6B5250

View File

@ -12,7 +12,7 @@ if (script === undefined) {
const attrs: { [name: string]: string; } = {};
for (let i = 0; i < script.attributes.length; i++) {
const attribute = script.attributes.item(i)!;
attrs[attribute.name] = attribute.value;
attrs[attribute.name.replace(/^data-/, '')] = attribute.value;
}
// gather page attributes