View Single Post
Old 03-27-2018, 08:18 PM   #395
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,753
Karma: 206739468
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I've found that using bs4's "html5lib" parser will preserve case in attribute names. As will sigil_gumbo_bs4_adapter.

Provided the xhtml variable contains markup with svg:

Code:
from sigil_bs4 import BeautifulSoup as bs4

soup=bs4(xhtml, "html5lib")
print(soup.prettify_xhtml())
or

Code:
import sigil_gumbo_bs4_adapter as bs4

soup=bs4.parse(xhtml)
print(soup.prettify_xhtml())
DiapDealer is offline   Reply With Quote