View Single Post
Old 12-17-2015, 06:30 PM   #8
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,734
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by KevinH View Post
FYI soup.prettify() will insert newlines around all tags even inline tags which can mess things up. That is why we added serialize_xhtml and prettyprint_xhtml to our own sigil_bs4.
Thanks for the information. If the bundled interpreter is selected, the plugin will actually use the following soup.prettyprint_xhtml() command:

Code:
bk.writefile(html_id, str(soup.prettyprint_xhtml(indent_level=0, eventual_encoding="utf-8", formatter="minimal", indent_chars="  ")))
Based on the output this seems to pretty much mimic the pretty printing that Sigil does.
Doitsu is offline   Reply With Quote