Skip to content

Parsing breaks when comments exists before <!DOCTYPE.. in svg file. #2532

Open
@henninghall

Description

@henninghall

Description

Comments like <!-- Generator: Adobe Illustrator 23.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> might be inserted into the svg file. When this is the case the SvgUri breaks throwing the error Cannot read property 'push' of null

Steps to reproduce

  1. Insert
<!-- comment  -->
<!DOCTYPE>

into a svg file.
2. Make the svg available on an URI.
3. render <SvgUri uri={URI} />

Snack or a link to a repository

SVG version

15.9.0

React Native version

0.76.1

Platforms

iOS

JavaScript runtime

Hermes

Workflow

Expo Dev Client

Architecture

Fabric (New Architecture)

Build type

None

Device

None

Device model

No response

Acknowledgements

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Missing infoThe user didn't precise the problem enoughMissing reproThis issue need minimum repro scenario

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions