View Single Post
Old 03-27-2018, 08:04 PM   #393
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,911
Karma: 6120478
Join Date: Nov 2009
Device: many
Only an html5 parser will grok svg properly. bs4 allows different parsers to work including gumbo, html, lxml, and html5lib. So have you tried using either the gumbo or html5lib parsers with bs4 (both are html5 parsers)?

Gumbo uses a lookup table to fix svg attribute names and html5lib uses a simple dictionary to fix the strange case issues with svg attributes.

See here for the html5lib version (and search for viewbox)

https://github.com/html5lib/html5lib...b/constants.py

At worst case you can post process the source to fix the bad all lowercase attributes.

Last edited by KevinH; 03-27-2018 at 08:10 PM.
KevinH is offline   Reply With Quote