That's the weird thing. I implemented your import code into the plugin as shown above. And when I used sigil_bs4 it did not remove the attributes and gave no error message at all. But when I checked the html afterwards -- all the attributes that should have been removed were still there.
I'm afraid that your sample code and suggestions didn't work.
Also, I've reinstalled Sigil and re-tested the plugin and the problem still remains the same. I'm somewhat stumped by this one. I'm now pretty convinced that sigil_bs4 does not have the same capabilities or behaviour as the bs4 version. Perhaps KevinH or DiapDealer might be able to confirm this.
Don't forget that I'm using the BeautifulSoup call like this:
for tag in soup():
for attribute in ["lang", "id", "dir", "name" "link"]:
del tag[attribute]
I'm not using any methods at all from the soup object in this initial call -- I'm calling the object directly like a function in my code. So here's my question:
Does the sigil_bs4 version allow direct object calls, without any arguments, or not ?
I know that you can use the original bs4 version with a no-argument object call because my code works with bs4. But it doesn't work with sigil_bs4. That's really why I need an answer to the above question.
Last edited by slowsmile; 11-15-2016 at 08:15 AM.
|