glutanimate / anki-addons-misc

Various add-ons I've written for Anki
https://ankiweb.net/shared/addons/
GNU Affero General Public License v3.0
171 stars 56 forks source link

Batch Remove Formatting (e.g. bold, italics, etc.) error. #72

Open oxk4r01 opened 5 years ago

oxk4r01 commented 5 years ago

Which add-on is affected?

[ Batch Remove Formatting (e.g. bold, italics, etc.) ]

Prerequisite checklist

[ Please enter an [ x ] character to confirm the points below: ]

What is the problem/feature you would like to see fixed/implemented?

[ Please be as specific as possible. Provide screenshots if you think they can help. ]

How can we reproduce the problem?

Addon not working. Throws this error:

An error occurred in an add-on. Please post on the add-on forum: https://anki.tenderapp.com/discussions/add-ons

Traceback (most recent call last): File "D:\OSCAR\PortableApps\AnkiPortable\Data\ankidata\addons\Batch_Remove_Formatting_eg_bold_italicsetc.py", line 76, in a.triggered.connect(lambda , b=browser: onClearFormatting(b)) File "D:\OSCAR\PortableApps\AnkiPortable\Data\ankidata\addons\Batch_Remove_Formatting_eg_bold_italics_etc.py", line 99, in onClearFormatting note.fields = stripFormatting(note.fields) File "D:\OSCAR\PortableApps\AnkiPortable\Data\ankidata\addons\Batch_Remove_Formatting_eg_bold_italics_etc.py", line 60, in stripFormatting soup = BeautifulSoup(html, "html.parser") File "thirdparty\BeautifulSoup.py", line 1521, in init File "thirdparty\BeautifulSoup.py", line 1146, in init File "thirdparty\BeautifulSoup.py", line 1188, in _feed File "sgmllib.py", line 104, in feed File "sgmllib.py", line 138, in goahead File "sgmllib.py", line 296, in parse_starttag File "sgmllib.py", line 338, in finish_starttag File "thirdparty\BeautifulSoup.py", line 1343, in unknown_starttag AttributeError: 'unicode' object has no attribute 'text' [ Version 2.0.36 portable ] [ Qt 4.8.1 PyQt 4.9.1 ]

System

ReflexivR commented 5 years ago

I get the same exact error on Windows 7, Anki 2.0.52.

glutanimate commented 5 years ago

Thanks for the reports, guys. I can reproduce the issue here. Seems like it's limited to Anki 2.0. I will look into a fix soon, but in the meantime if you depend on the add-on or its functionality upgrading to Anki 2.1 might be a viable option.

@oxk4r01 Your Anki version is very old at Anki 2.0.36. You should definitely consider upgrading to Anki 2.0.52 at least, as add-on authors will be unlikely/unable to support Anki versions as early as this in the future.