vsvg-parser
Advanced tools
Comparing version 0.1.0 to 0.2.0
var parser = require( '../' ), | ||
inspect = require( 'util' ).inspect; | ||
console.log( inspect( parser.parse( '<svg><line /></svg>'), { depth: Infinity, color: true } ) ); | ||
console.log( inspect( parser.parse( '<svg><svg:g></svg:g><line /></svg>'), { depth: Infinity, color: true } ) ); |
@@ -98,210 +98,2 @@ [ | ||
] | ||
}, | ||
{ | ||
"tagName": "dc:type", | ||
"attributes": { | ||
"rdf:resource": "http://purl.org/dc/dcmitype/StillImage" | ||
}, | ||
"children": [], | ||
"text": null, | ||
"inside": 6, | ||
"closed": true, | ||
"position": [ | ||
0, | ||
2, | ||
0, | ||
0, | ||
0, | ||
1 | ||
] | ||
}, | ||
{ | ||
"tagName": "dc:title", | ||
"attributes": {}, | ||
"children": [ | ||
{ | ||
"tagName": "g", | ||
"attributes": { | ||
"inkscape:label": "Layer 1", | ||
"inkscape:groupmode": "layer", | ||
"id": "layer1" | ||
}, | ||
"children": [ | ||
{ | ||
"tagName": "path", | ||
"attributes": { | ||
"sodipodi:type": "star", | ||
"style": "opacity:0.95999995;fill:#000000;fill-opacity:1;stroke:none", | ||
"id": "path2985", | ||
"sodipodi:sides": "5", | ||
"sodipodi:cx": "180", | ||
"sodipodi:cy": "172.36218", | ||
"sodipodi:r1": "145.71429", | ||
"sodipodi:r2": "72.857143", | ||
"sodipodi:arg1": "1.080839", | ||
"sodipodi:arg2": "1.7091575", | ||
"inkscape:flatsided": "false", | ||
"inkscape:rounded": "0", | ||
"inkscape:randomized": "0", | ||
"d": "m 248.57143,300.93362 -78.6199,-56.41057 -91.040494,32.7852 29.354754,-92.20379 -59.313638,-76.45348 96.762138,-0.57451 54.38265,-80.036041 30.44754,91.848721 92.92396,26.98848 -77.94452,57.34015 z", | ||
"inkscape:transform-center-x": "-6.2102955", | ||
"inkscape:transform-center-y": "-7.8751583" | ||
}, | ||
"children": [], | ||
"text": null, | ||
"inside": 10, | ||
"closed": true, | ||
"position": [ | ||
0, | ||
2, | ||
0, | ||
0, | ||
0, | ||
2, | ||
0, | ||
0 | ||
] | ||
}, | ||
{ | ||
"tagName": "path", | ||
"attributes": { | ||
"sodipodi:type": "star", | ||
"style": "opacity:0.95999995000000005;fill:#ff00ff;fill-opacity:1;stroke:none", | ||
"id": "path2987", | ||
"sodipodi:sides": "5", | ||
"sodipodi:cx": "422.85715", | ||
"sodipodi:cy": "706.64789", | ||
"sodipodi:r1": "122.69092", | ||
"sodipodi:r2": "61.345459", | ||
"sodipodi:arg1": "-2.0552743", | ||
"sodipodi:arg2": "-1.4269557", | ||
"inkscape:flatsided": "true", | ||
"inkscape:rounded": "0", | ||
"inkscape:randomized": "0", | ||
"d": "m 365.71429,598.07646 142.7423,20.67492 24.44679,142.14491 -127.63337,67.17546 -103.32854,-100.62819 z", | ||
"inkscape:transform-center-x": "5.4347258", | ||
"inkscape:transform-center-y": "6.4262155" | ||
}, | ||
"children": [], | ||
"text": null, | ||
"inside": 10, | ||
"closed": true, | ||
"position": [ | ||
0, | ||
2, | ||
0, | ||
0, | ||
0, | ||
2, | ||
0, | ||
1 | ||
] | ||
}, | ||
{ | ||
"tagName": "path", | ||
"attributes": { | ||
"sodipodi:type": "star", | ||
"style": "opacity:0.95999995000000005;fill:#ff7f2a;fill-opacity:1;stroke:none", | ||
"id": "path2989", | ||
"sodipodi:sides": "5", | ||
"sodipodi:cx": "282.85714", | ||
"sodipodi:cy": "466.6479", | ||
"sodipodi:r1": "124.17894", | ||
"sodipodi:r2": "62.089467", | ||
"sodipodi:arg1": "1.972667", | ||
"sodipodi:arg2": "2.6009855", | ||
"inkscape:flatsided": "false", | ||
"inkscape:rounded": "0", | ||
"inkscape:randomized": "0", | ||
"d": "m 234.28571,580.9336 -4.66385,-82.33095 -70.46629,-42.83271 76.86019,-29.87725 18.96104,-80.25346 52.16606,63.8658 82.18486,-6.76666 -44.61979,69.34849 31.83199,76.07143 -79.7426,-21.00608 z", | ||
"inkscape:transform-center-x": "8.6155008", | ||
"inkscape:transform-center-y": "-3.3614701" | ||
}, | ||
"children": [], | ||
"text": null, | ||
"inside": 10, | ||
"closed": true, | ||
"position": [ | ||
0, | ||
2, | ||
0, | ||
0, | ||
0, | ||
2, | ||
0, | ||
2 | ||
] | ||
}, | ||
{ | ||
"tagName": "path", | ||
"attributes": { | ||
"style": "fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1", | ||
"d": "m 160,952.36218 c 50.44957,-3.60354 26.6327,-2.85714 71.42857,-2.85714 7.61905,0 15.29693,0.94503 22.85714,0 0.94503,-0.11813 -0.67343,-2.18371 0,-2.85714 0.67344,-0.67344 1.90477,0 2.85715,0 0.95238,0 1.90476,0 2.85714,0 7.61905,0 15.2381,0 22.85714,0 19.04762,0 38.09524,0 57.14286,0 19.04762,0 38.09524,0 57.14286,0 5.71428,0 11.45204,0.51734 17.14285,0 12.105,-1.10046 19.70957,-4.96558 31.42858,-8.57143 6.62683,-2.03903 13.5287,-3.22533 20,-5.71429 5.96292,-2.29343 11.08194,-6.55112 17.14285,-8.57143 5.81378,-1.93792 32.29978,-4.39344 37.14286,-5.71428 4.1091,-1.12067 7.51377,-4.03652 11.42857,-5.71429 2.76818,-1.18636 5.71429,-1.90476 8.57143,-2.85714 2.85714,-0.95238 5.64966,-2.1267 8.57143,-2.85714 0.92394,-0.23099 2.00531,0.42591 2.85714,0 1.20468,-0.60234 1.65247,-2.25481 2.85714,-2.85715 2.69374,-1.34687 6.06555,-1.18655 8.57143,-2.85714 0.79243,-0.52828 0,-1.90476 0,-2.85714 0,-0.95238 0,-1.90476 0,-2.85714 0,-21.79611 -1.27775,2.25387 2.85715,-14.28572 0.46197,-1.84789 -0.37356,-3.84651 0,-5.71428 2.97268,-14.86343 1.90476,-2.85715 5.71428,-14.28572 0.30117,-0.90351 0,-1.90476 0,-2.85714 0,-4.76191 0,-9.52381 0,-14.28572 0,-11.42857 0,-22.85714 0,-34.28571 0,-5.71429 0,-11.42857 0,-17.14286 0,-1.90476 0.60234,-3.90727 0,-5.71428 -0.42592,-1.27776 -2.04902,-1.77965 -2.85714,-2.85715 -4.86691,-6.48921 -8.49207,-14.20635 -14.28572,-20 -3.36717,-3.36717 -8.06139,-5.20425 -11.42857,-8.57142 -17.05756,-1.97757 -7.90447,-18.2695 -14.28571,-25.71429 -9.12337,-10.64393 -11.99865,-5.71332 -20,-11.42857 -4.76191,-3.80953 -9.52381,-7.61905 -14.28572,-11.42857 -2.85714,0 -5.9453,1.12548 -8.57142,0 -4.37689,-1.87581 -6.91104,-7.06559 -11.42858,-8.57143 -4.51754,-1.50585 -9.56058,0.59064 -14.28571,0 -2.98844,-0.37356 -5.64966,-2.1267 -8.57143,-2.85714 -4.71121,-1.17781 -9.5745,-1.67934 -14.28571,-2.85715 -2.92177,-0.73044 -5.583,-2.48359 -8.57143,-2.85714 -4.72513,-0.59064 -9.55294,0.52586 -14.28572,0 -3.90275,-0.43364 -7.52582,-2.4235 -11.42857,-2.85714 -4.73278,-0.52587 -9.76817,1.50584 -14.28571,0 -4.51754,-1.50585 -6.91103,-7.06559 -11.42857,-8.57143 -4.51754,-1.50585 -9.55294,0.52586 -14.28572,0 -3.90275,-0.43364 -7.52582,-2.42351 -11.42857,-2.85714 -4.73278,-0.52587 -9.61628,0.93388 -14.28571,0 -0.93389,-0.18678 0.87537,-2.48199 0,-2.85715 -6.37284,-2.73121 -13.20121,-4.35452 -20,-5.71428 -2.80166,-0.56033 -5.71429,0 -8.57143,0 -6.79622,0 -16.55533,0.92394 -22.85714,-2.85715 -1.82611,-1.09566 -1.15348,-4.43653 -2.85715,-5.71428 -2.40935,-1.80702 -6.06555,-1.18656 -8.57143,-2.85714 -0.79242,-0.52829 0,-1.90477 0,-2.85715 -0.95238,-0.95238 -1.65246,-2.2548 -2.85714,-2.85714 -2.69374,-1.34687 -6.44184,-0.72755 -8.57143,-2.85714 -1.34687,-1.34687 1.58486,-4.65772 0,-5.71429 -2.37728,-1.58486 -5.8609,0.90351 -8.57143,0 -0.32967,-0.10989 0,-7.91209 0,-8.57143 0,-6.81791 0.18678,-6.48913 -2.85714,-17.14285 -0.58504,-2.04765 -1.90476,-3.80953 -2.85714,-5.71429 -1.90476,-3.80952 -4.36742,-7.38796 -5.71429,-11.42857 -0.34923,-1.04771 0,-16.65265 0,-17.14286 0,-6.39362 -0.72678,-14.18571 0,-20 0.35098,-2.8078 2.03883,-9.59084 5.71429,-11.42857 0.86867,-0.43434 9.45565,0 11.42857,0 2.85714,0 6.01592,1.27775 8.57143,0 1.90476,-0.95238 0.95238,-4.76191 2.85714,-5.71429 2.55551,-1.27775 5.86091,0.90351 8.57143,0 3.25764,-1.08588 5.65952,-3.89434 8.57143,-5.71428 4.70918,-2.94324 9.21105,-6.31603 14.28571,-8.57143 3.58833,-1.59481 7.65289,-1.77838 11.42857,-2.85714 2.89582,-0.82738 5.64966,-2.1267 8.57143,-2.85715 0.92395,-0.23098 1.92326,0.18678 2.85715,0 3.85051,-0.7701 7.61904,-1.90476 11.42857,-2.85714 3.80952,-0.95238 7.70331,-1.61539 11.42857,-2.85714 2.0203,-0.67344 3.69398,-2.18371 5.71428,-2.85714 3.72526,-1.24176 7.78266,-1.39878 11.42858,-2.85715 1.25053,-0.50021 1.6066,-2.35693 2.85714,-2.85714 3.64591,-1.45836 7.57806,-2.08704 11.42857,-2.85714 0.93389,-0.18678 1.90476,0 2.85714,0 8.19307,0 11.71643,0.69296 20,-2.85715 10.70925,2.80137 6.80885,-8.65673 11.42857,-11.42857 3.36718,-2.0203 8.0614,-0.83684 11.42858,-2.85714 1.8261,-1.09566 0.87987,-4.92338 2.85714,-5.71429 3.53705,-1.41482 7.92707,1.50065 11.42857,0 3.71391,-1.59167 5.33894,-6.14706 8.57143,-8.57142 0.7619,-0.57143 2.04048,0.48999 2.85714,0 4.0833,-2.44998 7.46643,-5.93 11.42857,-8.57143 1.77193,-1.18129 4.43654,-1.15348 5.71429,-2.85715 1.80701,-2.40935 0.72755,-6.44184 2.85714,-8.57142 2.12959,-2.12959 6.76441,-0.44779 8.57143,-2.85715 1.71429,-2.28571 -1.71429,-6.28571 0,-8.57143 1.80702,-2.40935 6.76441,-0.44778 8.57143,-2.85714 1.71428,-2.28571 -1.58486,-6.19414 0,-8.57143 2.64143,-3.96214 8.06139,-5.20425 11.42857,-8.57143 0.67344,-0.67343 -0.67344,-2.1837 0,-2.85714 0.67344,-0.67343 2.00531,0.42592 2.85714,0 3.53058,-1.76529 2.85715,-2.75852 2.85715,-5.71428 0,-1.62961 0.50404,-11.09255 0,-11.42858 -2.37729,-1.58485 -5.71429,0 -8.57143,0", | ||
"id": "path2991", | ||
"inkscape:connector-curvature": "0" | ||
}, | ||
"children": [], | ||
"text": null, | ||
"inside": 10, | ||
"closed": true, | ||
"position": [ | ||
0, | ||
2, | ||
0, | ||
0, | ||
0, | ||
2, | ||
0, | ||
3 | ||
] | ||
}, | ||
{ | ||
"tagName": "path", | ||
"attributes": { | ||
"style": "fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1", | ||
"d": "m 565.71429,186.6479 c 0.81701,-13.4687 -10.91854,3.36717 -14.28572,0 -0.67343,-0.67344 0.85184,-2.43123 0,-2.85715 -1.70367,-0.85183 -4.01061,0.85184 -5.71428,0 -0.85184,-0.42591 0.67343,-2.1837 0,-2.85714 -0.67344,-0.67343 -1.9332,0.23099 -2.85715,0 -2.92177,-0.73044 -5.87769,-1.51027 -8.57143,-2.85714 -1.20467,-0.60234 -1.65246,-2.25481 -2.85714,-2.85714 -0.91229,-0.45615 -25.70905,9.5e-4 -25.71428,0 -5.92623,-1.0775 -11.25318,-4.45222 -17.14286,-5.71429 C 464.79207,164.40946 464.9276,167.95988 440,166.6479 c -19.11616,-1.00612 -38.01683,-4.91737 -57.14286,-5.71429 -13.32177,-0.55507 -26.66666,0 -40,0 -20.95238,0 -41.90476,0 -62.85714,0 -6.66667,0 -13.33333,0 -20,0 -5.71429,0 -11.486,-0.80812 -17.14286,0 -1.33333,0.19048 -1.68773,2.18891 -2.85714,2.85714 -5.547,3.16972 -11.08194,6.55113 -17.14286,8.57143 -2.71052,0.90351 -5.9453,-1.12548 -8.57143,0 -4.37688,1.87581 -7.71014,5.59669 -11.42857,8.57143 -6.95727,5.56582 1.78947,3.21304 -14.28571,8.57143 -4.60701,1.53567 -10.04063,0.49876 -14.28572,2.85714 -4.7095,2.61639 -6.60986,9.01922 -11.42857,11.42857 -5.18151,2.59076 -12.42881,-0.51003 -17.14285,2.85715 -3.19535,2.28238 -0.0805,8.65192 -2.85715,11.42857 -2.0203,2.0203 -5.8609,-0.90351 -8.57143,0 -0.9035,0.30117 0.42592,2.00531 0,2.85714 -0.60233,1.20468 -2.43122,1.57939 -2.85714,2.85714 -0.60234,1.80702 0.85184,4.01062 0,5.71429 -0.42592,0.85184 -2.18371,-0.67344 -2.85714,0 -0.67344,0.67343 0.67343,2.18371 0,2.85714 -0.67344,0.67344 -2.18371,-0.67343 -2.85714,0 -0.67344,0.67344 0,1.90476 0,2.85715 0,4.55957 -0.69982,17.20074 0,20 0.32666,1.30665 2.11003,1.73647 2.85714,2.85714 1.18128,1.77192 1.35129,4.20844 2.85714,5.71428 0.67344,0.67344 2.00531,-0.42591 2.85714,0 1.20468,0.60234 1.65247,2.25481 2.85715,2.85715 0.85183,0.42591 1.93319,-0.23099 2.85714,0 2.92177,0.73044 5.64966,2.1267 8.57143,2.85714 0.92394,0.23099 1.90476,0 2.85714,0 5.42531,0 5.186,-0.52829 11.42857,5.71429 3.36718,3.36717 5.66805,7.65417 8.57143,11.42857 6.62074,8.60695 13.21655,17.23497 20,25.71428 0.84138,1.05173 2.07429,1.76115 2.85714,2.85715 3.99178,5.58849 7.07968,11.82753 11.42858,17.14285 4.26444,5.2121 9.97448,9.11225 14.28571,14.28572 1.2194,1.46328 -1.34687,4.36741 0,5.71428 1.34687,1.34687 4.22692,-1.18989 5.71429,0 4.20691,3.36553 7.61904,7.61905 11.42857,11.42857 0.95238,0.95238 1.65246,2.25481 2.85714,2.85715 2.69374,1.34687 5.95655,1.36292 8.57143,2.85714 8.9877,-1.53398 9.05654,8.29107 14.28571,11.42857 3.65222,2.19133 7.96274,3.23869 11.42857,5.71429 3.28798,2.34855 4.9574,6.76441 8.57143,8.57143 2.55551,1.27775 6.19414,-1.58486 8.57143,0 3.96215,2.64142 4.95592,8.32956 8.57143,11.42857 3.23381,2.77183 8.02123,3.15878 11.42857,5.71428 4.30999,3.23249 7.37408,7.88089 11.42857,11.42857 3.5837,3.13574 7.86948,5.4078 11.42857,8.57143 5.03332,4.47406 8.83941,10.32476 14.28572,14.28572 5.16682,3.75769 11.51773,5.54251 17.14286,8.57143 6.76055,3.6403 13.23944,7.78827 20,11.42857 5.62512,3.02891 11.62437,5.35231 17.14285,8.57143 5.93219,3.46044 10.76635,8.87796 17.14286,11.42857 3.53705,1.41482 8.09845,-1.85007 11.42857,0 5.88688,3.27049 8.26233,11.27402 14.28572,14.28571 4.25917,2.12959 9.76817,-1.50585 14.28571,0 19.80952,-23.23809 9.90476,10.28572 11.42857,11.42857 1.61059,1.20794 26.39799,13.35424 28.57143,14.28572 2.76818,1.18636 5.87769,1.51027 8.57143,2.85714 3.07133,1.53567 5.50009,4.17862 8.57143,5.71429 2.69374,1.34687 5.87769,1.51027 8.57143,2.85714 1.20467,0.60234 1.65246,2.2548 2.85714,2.85714 0.85183,0.42592 2.00531,-0.42592 2.85714,0 1.20468,0.60234 1.65247,2.25481 2.85714,2.85714 1.03324,0.51662 12.29846,0 14.28572,0", | ||
"id": "path2993", | ||
"inkscape:connector-curvature": "0" | ||
}, | ||
"children": [], | ||
"text": null, | ||
"inside": 10, | ||
"closed": true, | ||
"position": [ | ||
0, | ||
2, | ||
0, | ||
0, | ||
0, | ||
2, | ||
0, | ||
4 | ||
] | ||
} | ||
], | ||
"text": null, | ||
"inside": 9, | ||
"closed": true, | ||
"position": [ | ||
0, | ||
2, | ||
0, | ||
0, | ||
0, | ||
2, | ||
0 | ||
] | ||
} | ||
], | ||
"text": null, | ||
"inside": 6, | ||
"closed": false, | ||
"position": [ | ||
0, | ||
2, | ||
0, | ||
0, | ||
0, | ||
2 | ||
] | ||
} | ||
@@ -311,3 +103,3 @@ ], | ||
"inside": 5, | ||
"closed": false, | ||
"closed": true, | ||
"position": [ | ||
@@ -320,2 +112,34 @@ 0, | ||
] | ||
}, | ||
{ | ||
"tagName": "dc:type", | ||
"attributes": { | ||
"rdf:resource": "http://purl.org/dc/dcmitype/StillImage" | ||
}, | ||
"children": [], | ||
"text": null, | ||
"inside": 5, | ||
"closed": true, | ||
"position": [ | ||
0, | ||
2, | ||
0, | ||
0, | ||
1 | ||
] | ||
}, | ||
{ | ||
"tagName": "dc:title", | ||
"attributes": {}, | ||
"children": [], | ||
"text": null, | ||
"inside": 5, | ||
"closed": true, | ||
"position": [ | ||
0, | ||
2, | ||
0, | ||
0, | ||
2 | ||
] | ||
} | ||
@@ -325,3 +149,3 @@ ], | ||
"inside": 4, | ||
"closed": false, | ||
"closed": true, | ||
"position": [ | ||
@@ -337,3 +161,3 @@ 0, | ||
"inside": 3, | ||
"closed": false, | ||
"closed": true, | ||
"position": [ | ||
@@ -353,2 +177,145 @@ 0, | ||
] | ||
}, | ||
{ | ||
"tagName": "g", | ||
"attributes": { | ||
"inkscape:label": "Layer 1", | ||
"inkscape:groupmode": "layer", | ||
"id": "layer1" | ||
}, | ||
"children": [ | ||
{ | ||
"tagName": "path", | ||
"attributes": { | ||
"sodipodi:type": "star", | ||
"style": "opacity:0.95999995;fill:#000000;fill-opacity:1;stroke:none", | ||
"id": "path2985", | ||
"sodipodi:sides": "5", | ||
"sodipodi:cx": "180", | ||
"sodipodi:cy": "172.36218", | ||
"sodipodi:r1": "145.71429", | ||
"sodipodi:r2": "72.857143", | ||
"sodipodi:arg1": "1.080839", | ||
"sodipodi:arg2": "1.7091575", | ||
"inkscape:flatsided": "false", | ||
"inkscape:rounded": "0", | ||
"inkscape:randomized": "0", | ||
"d": "m 248.57143,300.93362 -78.6199,-56.41057 -91.040494,32.7852 29.354754,-92.20379 -59.313638,-76.45348 96.762138,-0.57451 54.38265,-80.036041 30.44754,91.848721 92.92396,26.98848 -77.94452,57.34015 z", | ||
"inkscape:transform-center-x": "-6.2102955", | ||
"inkscape:transform-center-y": "-7.8751583" | ||
}, | ||
"children": [], | ||
"text": null, | ||
"inside": 10, | ||
"closed": true, | ||
"position": [ | ||
0, | ||
3, | ||
0 | ||
] | ||
}, | ||
{ | ||
"tagName": "path", | ||
"attributes": { | ||
"sodipodi:type": "star", | ||
"style": "opacity:0.95999995000000005;fill:#ff00ff;fill-opacity:1;stroke:none", | ||
"id": "path2987", | ||
"sodipodi:sides": "5", | ||
"sodipodi:cx": "422.85715", | ||
"sodipodi:cy": "706.64789", | ||
"sodipodi:r1": "122.69092", | ||
"sodipodi:r2": "61.345459", | ||
"sodipodi:arg1": "-2.0552743", | ||
"sodipodi:arg2": "-1.4269557", | ||
"inkscape:flatsided": "true", | ||
"inkscape:rounded": "0", | ||
"inkscape:randomized": "0", | ||
"d": "m 365.71429,598.07646 142.7423,20.67492 24.44679,142.14491 -127.63337,67.17546 -103.32854,-100.62819 z", | ||
"inkscape:transform-center-x": "5.4347258", | ||
"inkscape:transform-center-y": "6.4262155" | ||
}, | ||
"children": [], | ||
"text": null, | ||
"inside": 10, | ||
"closed": true, | ||
"position": [ | ||
0, | ||
3, | ||
1 | ||
] | ||
}, | ||
{ | ||
"tagName": "path", | ||
"attributes": { | ||
"sodipodi:type": "star", | ||
"style": "opacity:0.95999995000000005;fill:#ff7f2a;fill-opacity:1;stroke:none", | ||
"id": "path2989", | ||
"sodipodi:sides": "5", | ||
"sodipodi:cx": "282.85714", | ||
"sodipodi:cy": "466.6479", | ||
"sodipodi:r1": "124.17894", | ||
"sodipodi:r2": "62.089467", | ||
"sodipodi:arg1": "1.972667", | ||
"sodipodi:arg2": "2.6009855", | ||
"inkscape:flatsided": "false", | ||
"inkscape:rounded": "0", | ||
"inkscape:randomized": "0", | ||
"d": "m 234.28571,580.9336 -4.66385,-82.33095 -70.46629,-42.83271 76.86019,-29.87725 18.96104,-80.25346 52.16606,63.8658 82.18486,-6.76666 -44.61979,69.34849 31.83199,76.07143 -79.7426,-21.00608 z", | ||
"inkscape:transform-center-x": "8.6155008", | ||
"inkscape:transform-center-y": "-3.3614701" | ||
}, | ||
"children": [], | ||
"text": null, | ||
"inside": 10, | ||
"closed": true, | ||
"position": [ | ||
0, | ||
3, | ||
2 | ||
] | ||
}, | ||
{ | ||
"tagName": "path", | ||
"attributes": { | ||
"style": "fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1", | ||
"d": "m 160,952.36218 c 50.44957,-3.60354 26.6327,-2.85714 71.42857,-2.85714 7.61905,0 15.29693,0.94503 22.85714,0 0.94503,-0.11813 -0.67343,-2.18371 0,-2.85714 0.67344,-0.67344 1.90477,0 2.85715,0 0.95238,0 1.90476,0 2.85714,0 7.61905,0 15.2381,0 22.85714,0 19.04762,0 38.09524,0 57.14286,0 19.04762,0 38.09524,0 57.14286,0 5.71428,0 11.45204,0.51734 17.14285,0 12.105,-1.10046 19.70957,-4.96558 31.42858,-8.57143 6.62683,-2.03903 13.5287,-3.22533 20,-5.71429 5.96292,-2.29343 11.08194,-6.55112 17.14285,-8.57143 5.81378,-1.93792 32.29978,-4.39344 37.14286,-5.71428 4.1091,-1.12067 7.51377,-4.03652 11.42857,-5.71429 2.76818,-1.18636 5.71429,-1.90476 8.57143,-2.85714 2.85714,-0.95238 5.64966,-2.1267 8.57143,-2.85714 0.92394,-0.23099 2.00531,0.42591 2.85714,0 1.20468,-0.60234 1.65247,-2.25481 2.85714,-2.85715 2.69374,-1.34687 6.06555,-1.18655 8.57143,-2.85714 0.79243,-0.52828 0,-1.90476 0,-2.85714 0,-0.95238 0,-1.90476 0,-2.85714 0,-21.79611 -1.27775,2.25387 2.85715,-14.28572 0.46197,-1.84789 -0.37356,-3.84651 0,-5.71428 2.97268,-14.86343 1.90476,-2.85715 5.71428,-14.28572 0.30117,-0.90351 0,-1.90476 0,-2.85714 0,-4.76191 0,-9.52381 0,-14.28572 0,-11.42857 0,-22.85714 0,-34.28571 0,-5.71429 0,-11.42857 0,-17.14286 0,-1.90476 0.60234,-3.90727 0,-5.71428 -0.42592,-1.27776 -2.04902,-1.77965 -2.85714,-2.85715 -4.86691,-6.48921 -8.49207,-14.20635 -14.28572,-20 -3.36717,-3.36717 -8.06139,-5.20425 -11.42857,-8.57142 -17.05756,-1.97757 -7.90447,-18.2695 -14.28571,-25.71429 -9.12337,-10.64393 -11.99865,-5.71332 -20,-11.42857 -4.76191,-3.80953 -9.52381,-7.61905 -14.28572,-11.42857 -2.85714,0 -5.9453,1.12548 -8.57142,0 -4.37689,-1.87581 -6.91104,-7.06559 -11.42858,-8.57143 -4.51754,-1.50585 -9.56058,0.59064 -14.28571,0 -2.98844,-0.37356 -5.64966,-2.1267 -8.57143,-2.85714 -4.71121,-1.17781 -9.5745,-1.67934 -14.28571,-2.85715 -2.92177,-0.73044 -5.583,-2.48359 -8.57143,-2.85714 -4.72513,-0.59064 -9.55294,0.52586 -14.28572,0 -3.90275,-0.43364 -7.52582,-2.4235 -11.42857,-2.85714 -4.73278,-0.52587 -9.76817,1.50584 -14.28571,0 -4.51754,-1.50585 -6.91103,-7.06559 -11.42857,-8.57143 -4.51754,-1.50585 -9.55294,0.52586 -14.28572,0 -3.90275,-0.43364 -7.52582,-2.42351 -11.42857,-2.85714 -4.73278,-0.52587 -9.61628,0.93388 -14.28571,0 -0.93389,-0.18678 0.87537,-2.48199 0,-2.85715 -6.37284,-2.73121 -13.20121,-4.35452 -20,-5.71428 -2.80166,-0.56033 -5.71429,0 -8.57143,0 -6.79622,0 -16.55533,0.92394 -22.85714,-2.85715 -1.82611,-1.09566 -1.15348,-4.43653 -2.85715,-5.71428 -2.40935,-1.80702 -6.06555,-1.18656 -8.57143,-2.85714 -0.79242,-0.52829 0,-1.90477 0,-2.85715 -0.95238,-0.95238 -1.65246,-2.2548 -2.85714,-2.85714 -2.69374,-1.34687 -6.44184,-0.72755 -8.57143,-2.85714 -1.34687,-1.34687 1.58486,-4.65772 0,-5.71429 -2.37728,-1.58486 -5.8609,0.90351 -8.57143,0 -0.32967,-0.10989 0,-7.91209 0,-8.57143 0,-6.81791 0.18678,-6.48913 -2.85714,-17.14285 -0.58504,-2.04765 -1.90476,-3.80953 -2.85714,-5.71429 -1.90476,-3.80952 -4.36742,-7.38796 -5.71429,-11.42857 -0.34923,-1.04771 0,-16.65265 0,-17.14286 0,-6.39362 -0.72678,-14.18571 0,-20 0.35098,-2.8078 2.03883,-9.59084 5.71429,-11.42857 0.86867,-0.43434 9.45565,0 11.42857,0 2.85714,0 6.01592,1.27775 8.57143,0 1.90476,-0.95238 0.95238,-4.76191 2.85714,-5.71429 2.55551,-1.27775 5.86091,0.90351 8.57143,0 3.25764,-1.08588 5.65952,-3.89434 8.57143,-5.71428 4.70918,-2.94324 9.21105,-6.31603 14.28571,-8.57143 3.58833,-1.59481 7.65289,-1.77838 11.42857,-2.85714 2.89582,-0.82738 5.64966,-2.1267 8.57143,-2.85715 0.92395,-0.23098 1.92326,0.18678 2.85715,0 3.85051,-0.7701 7.61904,-1.90476 11.42857,-2.85714 3.80952,-0.95238 7.70331,-1.61539 11.42857,-2.85714 2.0203,-0.67344 3.69398,-2.18371 5.71428,-2.85714 3.72526,-1.24176 7.78266,-1.39878 11.42858,-2.85715 1.25053,-0.50021 1.6066,-2.35693 2.85714,-2.85714 3.64591,-1.45836 7.57806,-2.08704 11.42857,-2.85714 0.93389,-0.18678 1.90476,0 2.85714,0 8.19307,0 11.71643,0.69296 20,-2.85715 10.70925,2.80137 6.80885,-8.65673 11.42857,-11.42857 3.36718,-2.0203 8.0614,-0.83684 11.42858,-2.85714 1.8261,-1.09566 0.87987,-4.92338 2.85714,-5.71429 3.53705,-1.41482 7.92707,1.50065 11.42857,0 3.71391,-1.59167 5.33894,-6.14706 8.57143,-8.57142 0.7619,-0.57143 2.04048,0.48999 2.85714,0 4.0833,-2.44998 7.46643,-5.93 11.42857,-8.57143 1.77193,-1.18129 4.43654,-1.15348 5.71429,-2.85715 1.80701,-2.40935 0.72755,-6.44184 2.85714,-8.57142 2.12959,-2.12959 6.76441,-0.44779 8.57143,-2.85715 1.71429,-2.28571 -1.71429,-6.28571 0,-8.57143 1.80702,-2.40935 6.76441,-0.44778 8.57143,-2.85714 1.71428,-2.28571 -1.58486,-6.19414 0,-8.57143 2.64143,-3.96214 8.06139,-5.20425 11.42857,-8.57143 0.67344,-0.67343 -0.67344,-2.1837 0,-2.85714 0.67344,-0.67343 2.00531,0.42592 2.85714,0 3.53058,-1.76529 2.85715,-2.75852 2.85715,-5.71428 0,-1.62961 0.50404,-11.09255 0,-11.42858 -2.37729,-1.58485 -5.71429,0 -8.57143,0", | ||
"id": "path2991", | ||
"inkscape:connector-curvature": "0" | ||
}, | ||
"children": [], | ||
"text": null, | ||
"inside": 10, | ||
"closed": true, | ||
"position": [ | ||
0, | ||
3, | ||
3 | ||
] | ||
}, | ||
{ | ||
"tagName": "path", | ||
"attributes": { | ||
"style": "fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1", | ||
"d": "m 565.71429,186.6479 c 0.81701,-13.4687 -10.91854,3.36717 -14.28572,0 -0.67343,-0.67344 0.85184,-2.43123 0,-2.85715 -1.70367,-0.85183 -4.01061,0.85184 -5.71428,0 -0.85184,-0.42591 0.67343,-2.1837 0,-2.85714 -0.67344,-0.67343 -1.9332,0.23099 -2.85715,0 -2.92177,-0.73044 -5.87769,-1.51027 -8.57143,-2.85714 -1.20467,-0.60234 -1.65246,-2.25481 -2.85714,-2.85714 -0.91229,-0.45615 -25.70905,9.5e-4 -25.71428,0 -5.92623,-1.0775 -11.25318,-4.45222 -17.14286,-5.71429 C 464.79207,164.40946 464.9276,167.95988 440,166.6479 c -19.11616,-1.00612 -38.01683,-4.91737 -57.14286,-5.71429 -13.32177,-0.55507 -26.66666,0 -40,0 -20.95238,0 -41.90476,0 -62.85714,0 -6.66667,0 -13.33333,0 -20,0 -5.71429,0 -11.486,-0.80812 -17.14286,0 -1.33333,0.19048 -1.68773,2.18891 -2.85714,2.85714 -5.547,3.16972 -11.08194,6.55113 -17.14286,8.57143 -2.71052,0.90351 -5.9453,-1.12548 -8.57143,0 -4.37688,1.87581 -7.71014,5.59669 -11.42857,8.57143 -6.95727,5.56582 1.78947,3.21304 -14.28571,8.57143 -4.60701,1.53567 -10.04063,0.49876 -14.28572,2.85714 -4.7095,2.61639 -6.60986,9.01922 -11.42857,11.42857 -5.18151,2.59076 -12.42881,-0.51003 -17.14285,2.85715 -3.19535,2.28238 -0.0805,8.65192 -2.85715,11.42857 -2.0203,2.0203 -5.8609,-0.90351 -8.57143,0 -0.9035,0.30117 0.42592,2.00531 0,2.85714 -0.60233,1.20468 -2.43122,1.57939 -2.85714,2.85714 -0.60234,1.80702 0.85184,4.01062 0,5.71429 -0.42592,0.85184 -2.18371,-0.67344 -2.85714,0 -0.67344,0.67343 0.67343,2.18371 0,2.85714 -0.67344,0.67344 -2.18371,-0.67343 -2.85714,0 -0.67344,0.67344 0,1.90476 0,2.85715 0,4.55957 -0.69982,17.20074 0,20 0.32666,1.30665 2.11003,1.73647 2.85714,2.85714 1.18128,1.77192 1.35129,4.20844 2.85714,5.71428 0.67344,0.67344 2.00531,-0.42591 2.85714,0 1.20468,0.60234 1.65247,2.25481 2.85715,2.85715 0.85183,0.42591 1.93319,-0.23099 2.85714,0 2.92177,0.73044 5.64966,2.1267 8.57143,2.85714 0.92394,0.23099 1.90476,0 2.85714,0 5.42531,0 5.186,-0.52829 11.42857,5.71429 3.36718,3.36717 5.66805,7.65417 8.57143,11.42857 6.62074,8.60695 13.21655,17.23497 20,25.71428 0.84138,1.05173 2.07429,1.76115 2.85714,2.85715 3.99178,5.58849 7.07968,11.82753 11.42858,17.14285 4.26444,5.2121 9.97448,9.11225 14.28571,14.28572 1.2194,1.46328 -1.34687,4.36741 0,5.71428 1.34687,1.34687 4.22692,-1.18989 5.71429,0 4.20691,3.36553 7.61904,7.61905 11.42857,11.42857 0.95238,0.95238 1.65246,2.25481 2.85714,2.85715 2.69374,1.34687 5.95655,1.36292 8.57143,2.85714 8.9877,-1.53398 9.05654,8.29107 14.28571,11.42857 3.65222,2.19133 7.96274,3.23869 11.42857,5.71429 3.28798,2.34855 4.9574,6.76441 8.57143,8.57143 2.55551,1.27775 6.19414,-1.58486 8.57143,0 3.96215,2.64142 4.95592,8.32956 8.57143,11.42857 3.23381,2.77183 8.02123,3.15878 11.42857,5.71428 4.30999,3.23249 7.37408,7.88089 11.42857,11.42857 3.5837,3.13574 7.86948,5.4078 11.42857,8.57143 5.03332,4.47406 8.83941,10.32476 14.28572,14.28572 5.16682,3.75769 11.51773,5.54251 17.14286,8.57143 6.76055,3.6403 13.23944,7.78827 20,11.42857 5.62512,3.02891 11.62437,5.35231 17.14285,8.57143 5.93219,3.46044 10.76635,8.87796 17.14286,11.42857 3.53705,1.41482 8.09845,-1.85007 11.42857,0 5.88688,3.27049 8.26233,11.27402 14.28572,14.28571 4.25917,2.12959 9.76817,-1.50585 14.28571,0 19.80952,-23.23809 9.90476,10.28572 11.42857,11.42857 1.61059,1.20794 26.39799,13.35424 28.57143,14.28572 2.76818,1.18636 5.87769,1.51027 8.57143,2.85714 3.07133,1.53567 5.50009,4.17862 8.57143,5.71429 2.69374,1.34687 5.87769,1.51027 8.57143,2.85714 1.20467,0.60234 1.65246,2.2548 2.85714,2.85714 0.85183,0.42592 2.00531,-0.42592 2.85714,0 1.20468,0.60234 1.65247,2.25481 2.85714,2.85714 1.03324,0.51662 12.29846,0 14.28572,0", | ||
"id": "path2993", | ||
"inkscape:connector-curvature": "0" | ||
}, | ||
"children": [], | ||
"text": null, | ||
"inside": 10, | ||
"closed": true, | ||
"position": [ | ||
0, | ||
3, | ||
4 | ||
] | ||
} | ||
], | ||
"text": null, | ||
"inside": 0, | ||
"closed": true, | ||
"position": [ | ||
0, | ||
3 | ||
] | ||
} | ||
@@ -355,0 +322,0 @@ ], |
'use strict'; | ||
var startTag = /^<([-A-Za-z0-9_]+)(.*?)(\/?)>/g, // match opening tag | ||
endTag = /<\/([-A-Za-z0-9_]+)[^>]*>/, // this just matches the first one | ||
var startTag = /^<([-A-Za-z0-9_:]+)(.*?)(\/?)>/g, // match opening tag | ||
endTag = /<\/([-A-Za-z0-9_:]+)[^>]*>/, // this just matches the first one | ||
attr = /([-A-Za-z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g; // match tag attributes | ||
@@ -6,0 +6,0 @@ |
{ | ||
"name": "vsvg-parser", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "A minimal implementation of a svg parser used in vsvg", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -76,3 +76,3 @@ var test = require( 'tape' ), | ||
test( 'testing parser::parse', function( t ) { | ||
var svg = '<svg foo:bar="baz" ><line foo="bar"></line><polygon /><g><line /></g></svg>', | ||
var svg = '<svg foo:bar="baz" ><line foo="bar"></line><polygon /><g><line /></g><svg:line></svg:line><g></g></svg>', | ||
tree = parser.parse( svg ); | ||
@@ -88,2 +88,4 @@ | ||
t.equals( tree[ 0 ].children[ 2 ].children[ 0 ].tagName, 'line', 'the nested, nest self closing tag is correct' ); | ||
t.equals( tree[ 0 ].children[ 3 ].tagName, 'svg:line', 'the addition of a colon to the tagname parses correctly' ); | ||
t.equals( tree[ 0 ].children[ 3 ].children.length, 0, 'the addition of a colon to the tagname does not mistakenly next sibling elements into it' ); | ||
@@ -90,0 +92,0 @@ // errors |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41068
613