target / react-native-svg-parser

Parses SVG files and converts to 'react-native-svg' format objects. NOTE: This project has been archived.
MIT License
42 stars 16 forks source link

Crash on render result involving <text> with <tspan> children #8

Closed oceanminded closed 6 years ago

oceanminded commented 6 years ago

Here's a string I've been able to replicate with. When it is parsed, and the result is rendered, react-native crashes. (but it is a valid SVG string)

<svg xmlns='http://www.w3.org/2000/svg' width='1200' height='2500' viewBox='0 0 1200 2500'> <rect width='1200' height='2500' x='0' y='0' fill='transparent' /> <g transform='translate(0, 0)'> <text x='76' y='72' fill='hsla(0, 0%, 0%, 1)' style='font: 18px "Helvetica Neue",Helvetica,Arial,sans-serif;'> <tspan x='76' dy='0' alignment-baseline='text-before-edge'> hi </tspan> </text> </g> </svg>

The issue seems to be with use of <text> and/or <tspan> but I'm not very familiar with SVG's. I'll keep digging on my end but would appreciate any help!