diff --git a/src/index.js b/src/index.js index 56ee5b9..9113b9a 100644 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,6 @@ import { locate } from 'locate-character'; -const validNameCharacters = /[a-zA-Z0-9:-]/; +const validNameCharacters = /[a-zA-Z0-9:_-]/; const whitespace = /[\s\t\r\n]/; const quotemark = /['"]/; diff --git a/test/samples/underscored-attribute/input.svg b/test/samples/underscored-attribute/input.svg new file mode 100644 index 0000000..ef389ee --- /dev/null +++ b/test/samples/underscored-attribute/input.svg @@ -0,0 +1 @@ + diff --git a/test/samples/underscored-attribute/output.json b/test/samples/underscored-attribute/output.json new file mode 100644 index 0000000..744f37f --- /dev/null +++ b/test/samples/underscored-attribute/output.json @@ -0,0 +1,13 @@ +{ + "type": "root", + "children": [ + { + "type": "element", + "tagName": "g", + "properties": { + "data-old_color": "red" + }, + "children": [] + } + ] +}