ps, to answer your question, the soup object should work as advertized in sigil_bs4. The changes we make actually fix a few namespace bugs, and add xhtml specific interface routines to the soup object to convert a bs4 tree back to xml and or xhtml.
So no, unless there is a name/namespace clash somehow, Doitsu's code should work.
But please note Doitsu's test plugin (at least the code shown in the second post) will not actually change the file inside Sigil since his demonstration plugin does not save the changes back it just prints them to the screen (there is no bk.writefile call). BTW, the readfile() call needs the manifest id which in this case just happens to be the same as the file name.
Hope something here helps,
KevinH
|