View Single Post
Old 01-24-2016, 06:26 PM   #24
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: 7,651
Karma: 5433388
Join Date: Nov 2009
Device: many
Hi rubeus,

Don't bother testing with sigil gumbo_bs4. It has two typos which I just now fixed that prevent it from working with foreign namespaced attributes well. Once I did fix those typos and adjusted your AdjustSVG code to use it, it worked like a charm. The correct SVG attribute names (mixed case) were used.

So the bug is not in sigil_bs4. It just serializes what it is given. The bug is in the default "html" parser which incorrectly changed the case of the svg attributes (and maybe even tag names). It is not properly keeping the mixed case attribute names. Once fixed, sigil_gumb_bs4_adapter works correctly with no changes in sigil_bs4.

If BS4 with html5lib messes with your doctype (that is strange), the only solution is to do what you are doing now and fix them after the fact using a regular expression replacement to make sure they are inside tags and not just a word in the text. Or alternatively strip off the doctype pass it to html5lib to parser and fix and then put it back at the end.

When Sigil-0.9.3 is released, I can post the adjusted code for using it which has no need of changing the attribute names after the fact.

Take care,

KevinH
KevinH is offline   Reply With Quote