diff options
author | ache <ache@ache.one> | 2019-12-16 17:41:06 +0100 |
---|---|---|
committer | ache <ache@ache.one> | 2019-12-16 17:41:06 +0100 |
commit | bae8eecdb821b80f4bfc6555b477fa340c3de0f6 (patch) | |
tree | 5823af1aaffe7c7653f01d615b07315c3b2c3504 /src | |
parent | Support for custom data attributes (diff) |
Better attribut name convention
Diffstat (limited to 'src')
-rw-r--r-- | src/index.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/index.js b/src/index.js index 3d8728b..9f5fd12 100644 --- a/src/index.js +++ b/src/index.js @@ -114,7 +114,7 @@ function filterAttributes(prop, config, type) { const isDangerous = p => DOMEventHandler.indexOf(p) >= 0; const isSpecific = p => type in specific && specific[type].indexOf(p) >= 0; - const isGlobal = p => htmlElemAttr['*'].indexOf(p) >= 0 || p.match(/^aria-[a-z]{2,24}$/) || p.match(/^data-[a-z]{2,24}$/); + const isGlobal = p => htmlElemAttr['*'].indexOf(p) >= 0 || p.match(/^aria-[a-z][a-z.-_0-9]*$/) || p.match(/^data-[a-z][a-z_.-0-9]*$/); let inScope = _ => false; |