View Single Post
Old 05-24-2020, 04:59 PM   #2104
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,252
Karma: 16544692
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
@jgoguen, @davidfor,

In the forced_cleanup method of your container.py file, have you considered letting calibre do the hard work using it's standard Beautify function?
Code:
from calibre.ebooks.oeb.polish.pretty import pretty_all
pretty_all(container)
I don't know whether it will fix your current <br/> problem but in my own plugins I've generally found it a more reliable option than regex when trying to sort out things like self-closing tags. It might even fix the encoding stuff at the same time.
jackie_w is offline   Reply With Quote