meerk40t / svgelements

SVG Parsing for Elements, Paths, and other SVG Objects.
MIT License
124 stars 28 forks source link

Cannot load href base64 data with newlines in the data block. #239

Closed tatarize closed 10 months ago

tatarize commented 10 months ago

See: meerk40t/meerk40t#2048

Image data:

<image
       width="256.12799"
       height="320.25601"
       preserveAspectRatio="none"
       xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABTYAAAaECAYAAADJwEHbAAABaWlDQ1BJQ0MgUHJvZmlsZQAAKM99&#10;kLFLAmEYxh+tEMqGqMGh4aZouEo0yKVBDaQIOqwgazrPUwO9Pu4uwmiL1hD6DzJoDhqSCIOWhoYg&#10;aoiorcmpoKXk6/3uLrSh3o+X78fD87y8vIA/pDJW6gZQNmwznUpIK5lVKfAKHz2nVM1icUWZF/zz&#10;/66PB9d7NyZmNVu1/dhe6qp8erGw/RiawP/Vm9Mtjf4v6rDGTBvwycTKls0E7xAPmbQUcVVwweUj&#10;wVmXzxzPUjpJfEMsaUU1R9wklrMdeqGDy6VNzdtBbB/UjeVFMYd6GDNYhwWGElRUIEFB9A//pONP&#10;YoPcFZiUK6AImzJxUsQEnXgWBjSMQyaOIEwdEXf27nfv3U9ua7svwHSDc37e1uYawMkUnaze1kZj&#10;wEAfcF1nqqk6Uhe1P58H3o6B/gwweEuZNSsfjbjbBxNAzzPn7yNA4ABoVTn/POS8VaPwE3BpfAMX&#

Does not correctly parse since the is \n and creates data blocks with newlines. This gets to the REGEX_DATA_URL and fails to parse as the xml.etree.ElementTree code already converted those newline over, and matches a single newline routine.

tatarize commented 10 months ago

Fixed via #240