svgdotjs / svg.import.js

A plugin for importing raw SVG into the svg.js library
99 stars 44 forks source link

Support elements with namespaces #36

Closed peteruithoven closed 10 years ago

peteruithoven commented 10 years ago

Inkscape uses namespaces in it's svg's, like:

<sodipodi:namedview
     id="base"
     pagecolor="#ffffff"
     bordercolor="#666666"
     borderopacity="1.0"
     inkscape:pageopacity="0.0"
     inkscape:pageshadow="2"
     inkscape:zoom="1.1607422"
     inkscape:cx="202.69645"
     inkscape:cy="657.84284"
     inkscape:document-units="px"
     inkscape:current-layer="layer1"
     showgrid="false"
     inkscape:window-width="960"
     inkscape:window-height="1152"
     inkscape:window-x="0"
     inkscape:window-y="0"
     inkscape:window-maximized="0" />

This wasn't supported by the properly close svg tags regular expression.

wout commented 10 years ago

Thanks, but can you also add spec examples for this modification?

peteruithoven commented 10 years ago

First time I used jasmine so I hope it's okay. It does fail on "Import svg() imports the use element correctly." but I didn't change anything there...

wout commented 10 years ago

Great, thanks! I'll have a look at the use problem.