5 2
Sign in to rate

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

<10kB. Updated 2018-09-25.
The author has shared 62 other item(s).

Description

Adds a menu entry to the card browser that removes specific HTML tags from all fields in all selected notes. (This is just a quick upload to make it easier for other users to install this add-on. I will try to flesh out the add-on description and documentation more soon). Usage In the card browser, select the cards you want to modify, then go to Edit → Batch-Remove Field Formatting. I haven't tested the add-on extensively, yet, so make sure to give it a try on a smaller number of cards first. You can use Ctrl+Z to undo its actions. Config The HTML tags to be removed can be specified in the user configuration section at the top of the source code. Changelog 2018-09-24 – Fix Anki 2.1 support (thanks to Arthur Milchior for the bug report!) 2018-09-14 – Initial AnkiWeb release License & Copyright Based on "Clear Field Formatting (HTML) in Bulk" by Felix Esch (https://github.com/Araeos/ankiplugins). The source code for the present version may be found here: https://github.com/glutanimate/anki-addons-misc/ (c) Felix Esch 2016 (https://github.com/Araeos>) (c) Glutanimate 2017-2018 (https://glutanimate.com/) License: GNU AGPLv3 or later (https://www.gnu.org/licenses/agpl.html) Support my work Support me on Patreon: https://www.patreon.com/glutanimate Buy me a coffee: https://glutanimate.com/tip-jar/

Download

As add-ons are programs downloaded from the internet, they are potentially malicious. You should only download add-ons you trust.

To download this add-on, please copy and paste the following code into Anki 2.1:

1734822644

If you were linked to this page from the internet, please open Anki on your computer, go to the Tools menu and then Add-ons>Browse & Install to paste in the code.

This add-on previously supported Anki 2.0. You can download the last version supporting 2.0 here. As Anki 2.0 has been discontinued, no support is available for this version.

All Anki 2.1.x Add-Ons

Reviews

on 1587040007
Great add-on, find a lot of use. It would be even better if there was an option to remove formatting only for certain fields.
on 1566959204
Works beautifully on Anki 2.1. Thanks Glutanimate!

The Anki 2.0 version did not work for me. Got a similar error message as reported below.
on 1566929830
I worked a treat for me. I'm running Anki 2.1 on an Ubuntu based Linux OS (Peppermint).
Had no issues with it.
on 1555260719
Didn't work for me either

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 "C:\Users\Albert\AppData\Roaming\Anki2\addons\Batch_Remove_Formatting_eg_bold_italics_etc.py", line 76, in <lambda>
a.triggered.connect(lambda _, b=browser: onClearFormatting(b))
File "C:\Users\Albert\AppData\Roaming\Anki2\addons\Batch_Remove_Formatting_eg_bold_italics_etc.py", line 99, in onClearFormatting
note.fields = stripFormatting(note.fields)
File "C:\Users\Albert\AppData\Roaming\Anki2\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 1337, in unknown_starttag
File "thirdparty\BeautifulSoup.py", line 1250, in endData
AttributeError: 'unicode' object has no attribute 'text'
on 1547924482
I'm not sure about the issue the other reviewer had. I've had no problems with it using installed Anki 2.1 on macOS.
on 1547924137
Worked great! Was able to customize the tags to be removed in the add-on file directly. Saved me a lot of time.
on 1547721077
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_italics_etc.py", line 76, in <lambda>
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'
Comment from author
Hi. Sorry to hear that. Would you mind posting a bug report here?: https://github.com/glutanimate/anki-addons-misc/issues/new

If you could fill out the info asked for in the bug report template, that would be very helpful also. This is the first report I have of an error like this, so any additional info you can provide would expedite the bug fixing process.