mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Make importing SVG documents work for documents with doctypes and comments in the beginning.
This commit is contained in:
parent
6425a01bbd
commit
c5262e02bd
1 changed files with 2 additions and 2 deletions
|
@ -167,7 +167,7 @@ new function() {
|
|||
// nodeNames still.
|
||||
var importers = {
|
||||
'#document': function(node, type, isRoot, options) {
|
||||
return importSVG(node.childNodes[0], isRoot, options);
|
||||
return importSVG(node.children[0], isRoot, options);
|
||||
},
|
||||
|
||||
// http://www.w3.org/TR/SVG/struct.html#Groups
|
||||
|
@ -536,7 +536,7 @@ new function() {
|
|||
var type = node.nodeName.toLowerCase(),
|
||||
importer = importers[type],
|
||||
item = importer && importer(node, type, isRoot, options) || null,
|
||||
data = type !== '#document' && node.getAttribute('data-paper-data');
|
||||
data = node.getAttribute && node.getAttribute('data-paper-data');
|
||||
if (item) {
|
||||
// See importGroup() for an explanation of this filtering:
|
||||
if (!(item instanceof Group))
|
||||
|
|
Loading…
Reference in a new issue