Fix data-* behavior (failure to understand own docs)

This commit is contained in:
Kane York 2014-10-05 15:11:26 -07:00
parent 0532468499
commit b79c835c07
1 changed files with 5 additions and 4 deletions

View File

@ -58,10 +58,11 @@ function validateAttribute(tagName, attribName, value) {
// data-* catch-all validators // data-* catch-all validators
if (tag && tag['data-*'] && !tag[attribName]) { if (tag && tag['data-*'] && !tag[attribName]) {
var permitted = tag['data-*']; var permitted = tag['data-*'];
if (permitted === value || permitted === '*' || if (permitted && (
((permitted instanceof RegExp) && permitted.test(value))) { permitted.indexOf(value) !== -1 ||
return value; permitted.indexOf('*') !== -1 ||
} ((permitted instanceof RegExp) && permitted.test(value)))
) { return value; }
} }
} }