svgdotjs / svg.import.js

A plugin for importing raw SVG into the svg.js library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Parse error

redon opened this issue · comments

Hallo
Thank you for the plugin!

Using closure-compiler on my script I get an error

ERROR - Parse error. missing name after . operator
draw.import(rawSvg);
^

does work when I change import to importSVG in your file (svg.import.js)

seems that import is reserved

commented

That could be the case indeed, I should have known. This will be fixed soon.

commented

This has been fixed. The import() method has been renamed to svg():

var draw = SVG('canvas')
draw.svg('<svg><rect width="100" height="100" /></svg>')