Skip to content

Commit

Permalink
Allow underscored attribute
Browse files Browse the repository at this point in the history
Fixes #4
  • Loading branch information
TrySound committed Jul 24, 2019
1 parent 6bb5fe8 commit 6336fd1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -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 = /['"]/;

Expand Down
1 change: 1 addition & 0 deletions test/samples/underscored-attribute/input.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions test/samples/underscored-attribute/output.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"type": "root",
"children": [
{
"type": "element",
"tagName": "g",
"properties": {
"data-old_color": "red"
},
"children": []
}
]
}

0 comments on commit 6336fd1

Please sign in to comment.