mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
Fix data-* behavior (failure to understand own docs)
This commit is contained in:
parent
0532468499
commit
b79c835c07
1 changed files with 5 additions and 4 deletions
|
@ -58,10 +58,11 @@ function validateAttribute(tagName, attribName, value) {
|
|||
// data-* catch-all validators
|
||||
if (tag && tag['data-*'] && !tag[attribName]) {
|
||||
var permitted = tag['data-*'];
|
||||
if (permitted === value || permitted === '*' ||
|
||||
((permitted instanceof RegExp) && permitted.test(value))) {
|
||||
return value;
|
||||
}
|
||||
if (permitted && (
|
||||
permitted.indexOf(value) !== -1 ||
|
||||
permitted.indexOf('*') !== -1 ||
|
||||
((permitted instanceof RegExp) && permitted.test(value)))
|
||||
) { return value; }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue