svgdotjs / svg.js

The lightweight library for manipulating and animating SVG
https://svgjs.dev
Other
11.01k stars 1.07k forks source link

Ignoring tspan element in .each() #1196

Closed standbyoneself closed 11 months ago

standbyoneself commented 3 years ago

svg.js@^2.7.1

I don't understand why svg.js ignores tspan while deep looping.

I'm trying to import raw svg and loop it. Text element that by default contains tspan is looped, but no text children (tspan's).

jsfiddle: https://jsfiddle.net/zxd2q1eu/1/

What is it?

standbyoneself commented 3 years ago

It seems to me that parser skips tspan, but what for?

Why I need to manually loop text.node.children and call SVG.adopt() on tspan to create an instance?

Fuzzyma commented 11 months ago

I think you are better off just using v3 for your needs https://jsfiddle.net/nu6zcbwh/