Skip to content

Commit 665f360

Browse files
treeformcursoragent
andcommitted
skip unsupported SVG tags when parsing
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 9b6b49d commit 665f360

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎src/pixie/fileformats/svg.nim‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,12 +492,15 @@ proc parseSvgElement(
492492
position: parseFloat(child.attr("offset"))
493493
))
494494
else:
495-
raise newException(PixieError, "Unexpected SVG tag: " & child.tag)
495+
when defined(pixieDebugSvg):
496+
echo "Skipping unexpected SVG tag: ", child.tag
496497

497498
svg.linearGradients[id] = linearGradient
498499

499500
else:
500-
raise newException(PixieError, "Unsupported SVG tag: " & node.tag)
501+
## Skip unsupported tags (mask, filter, text, etc.) and continue.
502+
when defined(pixieDebugSvg):
503+
echo "Skipping unsupported SVG tag: ", node.tag
501504

502505
proc parseSvg*(
503506
root: XmlNode, width = 0, height = 0

0 commit comments

Comments
 (0)