mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-19 14:10:14 -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.
|
// nodeNames still.
|
||||||
var importers = {
|
var importers = {
|
||||||
'#document': function(node, type, isRoot, options) {
|
'#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
|
// http://www.w3.org/TR/SVG/struct.html#Groups
|
||||||
|
@ -536,7 +536,7 @@ new function() {
|
||||||
var type = node.nodeName.toLowerCase(),
|
var type = node.nodeName.toLowerCase(),
|
||||||
importer = importers[type],
|
importer = importers[type],
|
||||||
item = importer && importer(node, type, isRoot, options) || null,
|
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) {
|
if (item) {
|
||||||
// See importGroup() for an explanation of this filtering:
|
// See importGroup() for an explanation of this filtering:
|
||||||
if (!(item instanceof Group))
|
if (!(item instanceof Group))
|
||||||
|
|
Loading…
Reference in a new issue