BigBadaboom / androidsvg

SVG rendering library for Android
http://bigbadaboom.github.io/androidsvg/
Apache License 2.0
1.21k stars 231 forks source link

Parsing Issue in Case of param:; #186

Closed olimaticer closed 5 years ago

olimaticer commented 5 years ago

Example

<text x='105' y='150' transform='rotate(45 105 150)' style='font-family:arial;font-size:8;font-weight:normal;font-style:normal;text-decoration:§§§;text-anchor:middle;stroke:rgba(0,0,255,1.0);stroke-width:0.3;fill:none;GRshape-rendering:crispEdges'>Print this drawing from (Chrome) Browser</text>

§§§ for text-decoration: is wrong and will be ignored, ;text-anchor:middle; ;stroke:rgba(0,0,255,1.0) and later will be executed correctly.

Is §§§ instead an empty string ;text-anchor:middle; ;stroke:rgba(0,0,255,1.0) and later will be ignored also. It seems the parser try in this case to interpret text-anchor as a value, middle as variable name and so on.

Downloads.zip

Where can I fix this?

Gregor

BigBadaboom commented 5 years ago

HI Thanks for the report.

Are you saying that text-annchor...etc is parsed when it shouldn't be, or not parsed when it should be? I can't tell from your description.

olimaticer commented 5 years ago

It will be parsed, if the value is a right one. In this case it returns the wished value. It will be parsed, if the value is a false one, the default value will be returned. It will be not parsed, if the string for interpretation of the value is an empty string, this and all following items returns only the defaults.

Or shorter, the parser stumbles over ":;" after the style tag.

BigBadaboom commented 5 years ago

Fixed. Improved style attribute parsing.