Skip to content

Commit

Permalink
Allow closing bracket on new line
Browse files Browse the repository at this point in the history
Ref #11
  • Loading branch information
TrySound committed Feb 25, 2020
1 parent 4ec8041 commit e83df3d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/index.js
Expand Up @@ -134,6 +134,8 @@ export function parse(source) {
error(`Expected closing tag </${tagName}> to match opening tag <${currentElement.tagName}>`);
}

allowSpaces();

if (source[i] !== '>') {
error('Expected >');
}
Expand Down
3 changes: 3 additions & 0 deletions test/samples/closing-bracket/input.svg
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/closing-bracket/output.json
@@ -0,0 +1,13 @@
{
"type": "root",
"children": [
{
"type": "element",
"tagName": "path",
"properties": {
"d": "M0,0 L10,0 L10,10 L0,10Z"
},
"children": []
}
]
}

0 comments on commit e83df3d

Please sign in to comment.