150 4
Contact Author Sign in to rate

Edit Field During Review

<10kB. Updated 2022-08-30.
The author has shared 37 other item(s).

Description

An experimental Anki add-on to be able to edit text in a field during review without opening the edit window. ---------- Edit Field During Review (Cloze) ---------- The updated version by BlueGreenMagick with cloze support and multiple improvements. https://ankiweb.net/shared/info/385888438 ---------------------------------------------------------- If you're still here... IMPORTANT WARNING The latest version of the add-on should prevent this by making the field to be uneditable, but just in case... DO NOT USE IT WITH CLOZE, LATEX OR AUDIO FIELDS Don't use the add-on with cloze fields, don't change {{cloze:Text}} to {{edit:cloze:Text}}, it won't work and some data will be lost after editing, either the text inside clozes will be lost or cloze tags will be lost, and it can only be restored from a backup - https://apps.ankiweb.net/docs/manual.html#backups If you use the add-on with audio fields, the "[sound:...]" tag will be lost after editing. Instead, use the Edit Field During Review (Cloze) - https://ankiweb.net/shared/info/385888438 KNOWN BUGS Doesn't seem to work in the Preview window (2.1.50). HOW TO USE Open the Card Template and replace {{Field}} with {{edit:Field}}. This is similar to {{type:Foreign Word}} or {{hint:MyField}}. During review click on the field, edit it and click outside of it or press Esc to save it, or press Ctrl+Z to undo any changes. Press Tab or Shift+Tab to switch between different editable fields. And it looks like it's possible to use Ctrl+B (bold), Ctrl+I (italic) and Ctrl+U (underline) shortcuts too. The implementation is very simple. The addon just replaces any {{edit:Field}} with <div contenteditable="true">{{Field}}</div> to make it editable. Tag "div" can be replaced with tag "span" to make it inline by updating the add-on's config file (Tools - Add-ons - Edit Field During Review - Config). The relevant post on Reddit - https://www.reddit.com/r/Anki/comments/acvx71/edit_field_during_review IMPORTANT NOTE & WARNING P̵l̵e̵a̵s̵e̵ ̵n̵o̵t̵e̵ ̵t̵h̵a̵t̵ ̵a̵s̵ ̵f̵o̵r̵ ̵n̵o̵w̵ ̵t̵h̵e̵ ̵a̵d̵d̵-̵o̵n̵ ̵i̵s̵ ̵p̵r̵e̵t̵t̵y̵ ̵d̵u̵m̵b̵ ̵a̵n̵d̵ ̵i̵f̵ ̵t̵h̵e̵ ̵e̵d̵i̵t̵a̵b̵l̵e̵ ̵f̵i̵e̵l̵d̵ ̵i̵s̵ ̵s̵t̵i̵l̵l̵ ̵a̵c̵t̵i̵v̵e̵ ̵a̵n̵d̵ ̵s̵o̵m̵e̵t̵h̵i̵n̵g̵ ̵h̵a̵p̵p̵e̵n̵s̵ ̵t̵h̵a̵t̵ ̵c̵h̵a̵n̵g̵e̵s̵ ̵t̵h̵e̵ ̵c̵u̵r̵r̵e̵n̵t̵ ̵c̵a̵r̵d̵,̵ ̵t̵h̵e̵ ̵e̵d̵i̵t̵a̵b̵l̵e̵ ̵d̵a̵t̵a̵ ̵m̵a̵y̵ ̵b̵e̵ ̵s̵i̵l̵e̵n̵t̵l̵y̵ ̵w̵r̵i̵t̵t̵e̵n̵ ̵i̵n̵ ̵t̵h̵e̵ ̵w̵r̵o̵n̵g̵ ̵c̵a̵r̵d̵,̵ ̵i̵.̵e̵.̵ ̵i̵n̵ ̵t̵h̵e̵ ̵n̵e̵w̵ ̵c̵a̵r̵d̵ ̵i̵n̵s̵t̵e̵a̵d̵ ̵o̵f̵ ̵t̵h̵e̵ ̵o̵l̵d̵ ̵c̵a̵r̵d̵.̵ ̵P̵l̵e̵a̵s̵e̵ ̵s̵e̵e̵ ̵t̵h̵e̵ ̵c̵h̵a̵n̵g̵e̵l̵o̵g̵ ̵f̵o̵r̵ ̵2̵0̵1̵9̵-̵0̵3̵-̵0̵5̵ ̵b̵e̵l̵o̵w̵.̵ ̵I̵ ̵c̵a̵n̵'̵t̵ ̵r̵e̵p̵r̵o̵d̵u̵c̵e̵ ̵i̵t̵ ̵w̵i̵t̵h̵ ̵t̵h̵e̵ ̵r̵e̵v̵i̵e̵w̵ ̵w̵i̵n̵d̵o̵w̵,̵ ̵b̵u̵t̵ ̵i̵t̵ ̵s̵t̵i̵l̵l̵ ̵m̵a̵y̵ ̵h̵a̵p̵p̵e̵n̵. Fixed 2020-01-29 Old version of the add-on contained a bug that resulted in a broken image if the edited field contained a picture. It can be fixed by following the instructions on https://ankiweb.net/shared/info/574601404 OTHER NOTES By default, if the contenteditable field isn't active anymore, it's possible to undo the last edit by using Edit - Undo option. But if the current card has been edited and this option is enabled, it'll be impossible to Undo Review and move back to the previous card. Please edit the add-on's config file and change "undo": true to "undo": false to disable it or maybe open the cards browser and search for rated:1 (cards answered today) and maybe sort by the "changed" column ("changed" tracks the last time changes were made to the card (e.g., when you reviewed the card and the review history and interval were updated)). CHANGELOG 2019-01-05 Initial release 2019-01-13 Updated plain JavaScript to jQuery 2019-01-13 Added a fix to support Speed Focus Mode add-on - https://ankiweb.net/shared/info/1046608507 2019-01-21 Added cards browser preview window 2019-01-24 Support Tags field - https://apps.ankiweb.net/docs/manual.html#special-fields 2019-02-13 Support Undo button to revert back the last edit 2019-02-26 Unescape filenames on save 2019-03-05 Disable cards browser preview window (bug #1, bug #2) 2019-03-09 Added config option to disable Undo button 2019-07-02 Basic support for Anki 2.0 2020-01-29 Fix a bug when changes could have been written to a different card 2020-10-07 Don't make a field to be editable if it contains sound, cloze or latex tags (Anki 2.1.25+) 2022-08-30 Fix cloze regex to make cloze field uneditable in old Anki versions and Anki 2.1.55 (Expose cloze text as HTML attribute on question side) DONATE & SUPPORT Nickolay Nonard <kelciour@gmail.com>

Download

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

Supported Anki versions:

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

1020366288

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

All Anki 2.1.x Add-Ons Contact Author

Reviews

on 1685880561
I'm often editing a particular field for cards on a machine-translated deck, and this saves a lot of time.
on 1683405169
Thanks saves time
on 1678814900
Obrigado por disponibilizar o Add-ons Edit Field During Review. Ele Show!!!
on 1678190885
wow
on 1677941326
for me the CTRL+U+B unfortunately never worked. Everything else is perfect. So if you also want to use bold (and it doesn't work for you, than you can use https://ankiweb.net/shared/info/385888438
on 1675463334
very good, keep the work going
on 1673691182
Very useful!
on 1672940466
Thanks! It is working on anki-2.1.54-windows-qt6
on 1667287245
good
on 1666875932
Just great. Thanks for the tip on editing the colour during review!
on 1665198453
Excellent add-on; it really speeds up the workflow. However, when I write something in an empty field, the add-in does not add what was written to the field after editing and grading the card, even if I press Esc.
on 1662915342
Great! Is there a way to add an additional shortcut for another highlight color?
Ctl + q for blue and Ctl + w for yellow?
on 1662659150
好用!能在预览窗口里也实现这个吗,我试了下,不像在复习区,它修改之后没有保存
on 1662256660
Thank you
Very nice
---------------------
Can I set the default state to edit mode?
Because there are too many cards to modify.
on 1661805190
New Update freezes anki
on 1659787752
Brilliant add-on way more intuitive than the native editor for making tweaks. Still waiting for vi mode though 😉
on 1659404005
thanks!
on 1655887930
Great
on 1654635267
Hi, just upgraded to the newest version of Anki and the field becomes editable even when I do not hold down "command". This is really annoying. Is there anyway to fix this. Felt like I might have had this issue before but can't remember how I fixed it.
on 1651321429
I love this addon
on 1644735802
There is a bug in this add-on——the hyperlink won't work in a field which could be edited in review. Cause when I click on the word with a hyperlink, it would just become editing mode.(Well, I don't know if I explain it clearly😂

And I'm sorry that I don't know how to change this field into editable in review.
Would you be kind enough to assist me with me ? 🤕Thanks a lot!

<div id="card-body">
<div id="main-section" class="content">
</span>
<!-- this element will contain the actual content - the enhanced clozes -->
<span id="enhanced-clozes"></span>
</div>
<br>
<br>
<hr>
<br>
<p class="" style="margin: 5.5px;"></p>
<div>
on 1641218397
thank you so much,I love this add-on
on 1639305038
Beaucoup plus léger pour corriger les cartes que de devoir passer par l'éditeur.
Merci
on 1637704196
PERFECT. Thanks!
on 1637636578
gooooood
on 1636716458
This is a ridiculously useful add-on. Given how laggy 2.1 has become, making small edits is really cumbersome. This Add-on reduces the time wasted to zero, making me much more likely to actually bother making these changes. These might be small changes, yes, but removing silly typos that would otherwise keep assaulting you in every review makes the experience much more pleasant. And sometimes, a tiny bit of formatting or a sentence turned around makes a surprisingly big change in retention. I believe this effect to be pretty big over incremental periods of time.

It's a bit buggy on my computer so serious reformatting or rewriting still requires to open the edit field, but it's incredibly useful nonetheless.

Easily my favourite add-on!
on 1633230815
nice
on 1629081124
Works well with Basic cards. DO NOT USE WITH CLOZE you will lose a lot of your cards.
on 1628002421
Great, thanks a lot!
on 1627532063
This is extremely useful. Very brilliant work! Thank you!
on 1626608962
thank you
on 1625794124
Thanks, Can this be only used for cards in review state?
I am not able to edit the cards that are in a new or learning state.
on 1625714695
good add - on
on 1625493147
Changes are not saved after editing.

Edit: Thanks for replying. It was because of the script I used for my cards. I can't delete the script because it's important, but now I knew it's not because of the add on. So thump up for you (y)
Btw, despite of the script, changes are only saved after the 3rd time I edit the card, which is odd.
Comment from author before post was edited
It doesn't matter, but I assume you're using the latest Anki version.

Maybe there's a conflict with another add-on or the card template contains some JavaScript code that breaks the add-on.

Maybe try to test with the Basic note type by temporarily disabling all add-ons except this one. It should work fine.
on 1624318856
Thank you
on 1624174467
Big time saver.
on 1622303505
Works perfectly.
on 1621524439
Hmm
on 1621147176
awesome to use
on 1620987284
One of the best addons
on 1620231611
It is extremely usable but why does some self-made decks not work with this add-on? (basic and reverse without audio)
Same recently, I have just the basic note type and I can't edit during review ? I gave a thumbs down so it can be noticed.
I just created a new deck with basic cards and everything really simple but I doesn't allow me to edit
Comment from author
I'm out of ideas and can't reproduce the issue as it's working fine for me. Here's a quick video - https://imgur.com/d1xXPOO

Maybe start Anki with -b option to specify a custom folder location - https://docs.ankiweb.net/files.html?#startup-options
---
1. Edit the card at fault, click Cards... to open the card template window and make sure that {{Front}} (or some other field) has "edit:" prefix, i.e. {{edit:Front}}.
2. If the field still isn't editable, maybe the field contains cloze deletions, latex or sound tags. The add-on doesn't support them at the moment and the field can't be edited during review.
3. If it's still not the case, maybe the card template contains some javascript code in <script>...</script> tag, maybe with innerHTML assignment somewhere, that stops the add-on from working.
4. If it's still not the case, maybe temproraily disable all add-ons except this one and restart Anki to see if it works now.

That should be it. I can't think of any other reason why the add-on wouldn't work.
on 1620015663
Doesn't work for "Version ⁨2.1.38+"

Edit*
I tried your fix, but it still won't work :(.
Comment from author
Another reason why the add-on might not work is that the field contains cloze deletions, sound or latex tags. The add-on doesn't support them at the moment and in this case the field can't be edited during review.
---
I need more information. I guess by "won't work" you mean the field isn't editable once you click it, i.e. nothing happens once you click it. Did you "open the card template and replace {{Field}} with {{edit:Field}}"? If you didn't do it, the add-on won't work.
---
Thank you for the downvote but it's working fine for me with the latest Anki version.

Maybe try to temporarily disable all add-ons except this one and try with the Basic note type.
on 1619109708
Amazing!!!
on 1618673713
Useful
on 1616048820
Thanksss
on 1615664096
Thank you <3
on 1615018014
I 'm very grateful for this ,but there is a bug I find when I use the command+u, the situation is the command+u or ctrl+u could be used only once, which has lead me used undo if I want to cancel this, so that 's very inconvenient when I have to undo many steps to achieve pressing twice command+u or ctrl+u.
on 1614718928
Great!
on 1614011779
Thanks so much! It helps a lot!

Would be perfect if it allows pasting pictures to fields during review :)
on 1613041486
Thank you so much, this add-ons saved my life
on 1612629654
Unfortunately it seems like it is not compatible with Anki 2.1.35 but I think this is a pretty amazing idea and I really hope u guys can fix this:(
on 1612091835
Great! ... Are there any shortcuts to change the color of a word to a certain color
on 1611679836
Save me a lot of time! Thank u
on 1611564353
Time saving and hassle free!!
on 1611135028
Excellent. Makes editing during review quick and easy.
It seems to add line breaks to the display, I had to tweak a couple of card templates to maintain the layout. This also meant I couldn't use it where multiple fields display on a single line.
But overall it saves time and effort and means it's always worthwhile making even the tiniest edits.
on 1610839214
buenisimo el complemento, gracias Dios que existe esta gente UwU.
on 1610732718
Very usefull
on 1610220420
nice
on 1608316466
Great add-on! Thanks.
on 1606156656
[HELP] How do I change the editing option to "ctrl + click", just as it is in "Edit Field During Review (Cloze)", this way the buttons and links would work within the field?
on 1605473122
This is probably the most useful extension especially for new Anki users. Fixing cards on the fly saves so much time. Thank you!
on 1604514221
Why don't you merge this addon with Edit-Field-During-Review-Cloze and keep the best features of both (for example image editing while reviewing, cloze ecc.)? it seems pointless to me to keep updating two addons that do the same thing, instead of working together for the same goal! This is just a suggestion of course
Comment from author
The main reason I couldn't merge it because I was interested and still interested to implement a few changes myself.

Another reason is that I thought about adding a link to my Patreon page once I add clozes and images and maybe make a few new add-ons. It's been almost 2 years, it didn't happen, it still might happen in the future, but it'd take quite a lot of time and for the time being it's not a high priority to update the add-on.

Maybe another reason.

P.S. I noticed you asked BlueGreenMagick about it too. BlueGreenMagick initially sent a pull request - https://github.com/kelciour/edit-field-during-review/pull/4 - but I couldn't accept it and suggested to upload it on AnkiWeb as a new add-on so I could mention it in the description. It seems it worked well in the past few years.
on 1602610433
Hey I keep getting this error , but otherwise good add on.

Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue on the add-on support site.
Debug info:
Anki 2.1.33 (3f403040) Python 3.8.0 Qt 5.14.2 PyQt 5.14.2
Platform: Mac 10.16
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2020-10-12 12:05:32
Add-ons possibly involved: ⁨Edit Field During Review Cloze⁩

Caught exception:
Traceback (most recent call last):
File "aqt/webview.py", line 37, in cmd
File "aqt/webview.py", line 123, in _onCmd
File "aqt/webview.py", line 547, in _onBridgeCmd
File "</Applications/Anki.app/Contents/MacOS/decorator.pyc:decorator-gen-22>", line 2, in _linkHandler
File "anki/hooks.py", line 638, in decorator_wrapper
File "anki/hooks.py", line 635, in repl
File "/Users/13deol/Library/Application Support/Anki2/addons21/385888438/reviewer.py", line 193, in myLinkHandler
saveThenRefreshFld(reviewer, note, fld, new_val)
File "/Users/13deol/Library/Application Support/Anki2/addons21/385888438/reviewer.py", line 153, in saveThenRefreshFld
saveField(note, fld, new_val)
File "/Users/13deol/Library/Application Support/Anki2/addons21/385888438/reviewer.py", line 135, in saveField
txt = Editor.mungeHTML(None, txt)
File "aqt/editor.py", line 421, in mungeHTML
File "aqt/gui_hooks.py", line 1606, in __call__
File "aqt/editor.py", line 1217, in reverse_url_quoting
AttributeError: 'NoneType' object has no attribute 'mw'

If you could fix it that will be great.
Comment from author
Hi. Thank you for the upvote. You're using Edit Field During Review (Cloze) - https://ankiweb.net/shared/info/385888438 - and there's nothing much I can do. But the error can be fixed manually by editing reviewer.py (Tools - Add-ons - ... - View Files) and applying similar changes in green from the pull request with a fix.

https://github.com/BlueGreenMagick/Edit-Field-During-Review-Cloze/pull/37/files

or replacing the whole file with the updated version

https://github.com/BlueGreenMagick/Edit-Field-During-Review-Cloze/blob/fe6d1d442168397a7b6786c853484eee0e9952ac/edit_field_during_review_cloze/reviewer.py
on 1602349524
thanks a lot!!!!!!!!
on 1602128984
a must have and 5 stars! if only I can edit picture's size.......
on 1601487422
A must have and a must rate 5!
on 1600750210
Great add-on,but unfortunately I got an error:

Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue on the add-on support site.
Debug info:
Anki 2.1.33 (3f403040) Python 3.8.0 Qt 5.14.1 PyQt 5.14.1
Platform: Windows 10
Flags: frz=True ao=True sv=1
Add-ons, last update check: 2020-09-21 17:27:13

1600707171015 == 1600707199665
Traceback (most recent call last):
File "aqt\webview.py", line 37, in cmd
File "aqt\webview.py", line 123, in _onCmd
File "aqt\webview.py", line 541, in _onBridgeCmd
File "aqt\gui_hooks.py", line 2852, in __call__
File "D:\AnkiDataFolder\addons21\1020366288\__init__.py", line 105, in on_js_message
assert nid == note.id, "{} == {}".format(nid, note.id)
AssertionError: 1600707171015 == 1600707199665
Comment from author
Hi, thank you for the feedback. It looks like you're the second person with the same error message. It was supposed to be just a safeguard check and should never be fired.

Could you paste Help - About - Copy Debug Info? If there's a way to reproduce it, please let me know too.

Either here, by email or https://github.com/kelciour/edit-field-during-review/issues/7
on 1600265565
Great add-on! Could u pls also tweak to make it compatible with the wrap text add on? Here's the link: https://ankiweb.net/shared/info/2028179508
Thanks in advance! :)
Comment from author
It'd nice not to clutter the card template with the extra code but at the moment I can only suggest to add the following code in the card template to make it work like https://ankiweb.net/shared/info/2028179508 using Ctrl+R shortcut.

1. Copy <script>...</script> tag from https://github.com/ijgnd/anki21__remove_linebreaks__do_word_wrap/blob/525e3a2427e937d0029abecd29d5c42430813691/src/remove_linebreaks.py#L41-L65
2. Remove the line saveField('key');
3. Before </script> add something like

$('[contenteditable=true]').keydown(function(e){
if(e.ctrlKey && e.keyCode == 82){ // Ctrl + R - https://keycode.info
remove_breaks();
}
});

---------------------------

The Front Template might look something like this - https://gist.github.com/kelciour/01a5ea322cfaa8c01e82b5aa76a68b4d
on 1600001023
Excellent and fast support!

Don`t know, if it helps you:
Caught exception:
Traceback (most recent call last):
File "aqt\webview.py", line 37, in cmd
File "aqt\webview.py", line 123, in _onCmd
File "aqt\webview.py", line 547, in _onBridgeCmd
File "<C:\Program Files (x86)\Anki\decorator.pyc:decorator-gen-34>", line 2, in linkHandler_wrapper
File "anki\hooks.py", line 638, in decorator_wrapper
File "anki\hooks.py", line 635, in repl
File "C:\Users\domin\AppData\Roaming\Anki2\addons21\385888438\reviewer.py", line 193, in myLinkHandler
saveThenRefreshFld(reviewer, note, fld, new_val)
File "C:\Users\domin\AppData\Roaming\Anki2\addons21\385888438\reviewer.py", line 153, in saveThenRefreshFld
saveField(note, fld, new_val)
File "C:\Users\domin\AppData\Roaming\Anki2\addons21\385888438\reviewer.py", line 135, in saveField
txt = Editor.mungeHTML(None, txt)
File "aqt\editor.py", line 421, in mungeHTML
File "aqt\gui_hooks.py", line 1606, in __call__
File "aqt\editor.py", line 1217, in reverse_url_quoting
AttributeError: 'NoneType' object has no attribute 'mw'

I noticed that the AssertionError is often coming, when I copy and paste something during review. I also tried the other Addon, it´s the same.
Comment from author
If you use 385888438, there will be no AssertionError or it will be different. I can't help with it at the moment.

I don't know when 385888438 will be updated, I'm not the author, but for now 'NoneType' object has no attribute 'mw' can be fixed by manually editing the file (Tools - Add-ons - ... - View Files) and applying similar changes (in green).

https://github.com/kelciour/edit-field-during-review/commit/d5525dc4ce9f9a35956c99bb58672b6050187b36

If you use 1020366288, i.e. this add-on, last time I updated the add-on and added the error message to the AssertionError. If it happens again, please post it here.

When you copy and paste something, do you copy it from Anki itself, i.e. from the card browser, or from your web browser? I can't seem to reproduce it.

Could you paste Help - About - Copy Debug Info?

---

I've updated the add-on and added the error message for AssertionError. Maybe it'll help to find a way to fix it.

If there's a way to reproduce it, please let me know.
on 1599536738
great add-on.
modify the add-on file meta.json(C:\Users\Username\AppData\Roaming\Anki2\addons21\1020366288) :"max_point_version": -26 → "max_point_version": -33,that make it compatible with 2.1.33.If any errors occurred,click the close button.You may need to modify this file every time you open anki.
Comment from author
Thank you. The fix was just a one line change and the add-on should work fine with 2.1.33. Use Tools - Add-ons - Check for Updates to update the add-on or maybe uninstall and install it again.
on 1599488978
PLEASE MAKE COMPATIBLE WITH NEWEST ANKI VERSION 2.1.33 :(

This was my favorite add on but now it is unusable.
on 1599091535
Please update for 2.1.26+
Comment from author
Thank you. It's been updated to support 2.1.33.
on 1598604124
NICE !
Can I make a word font-size bigger than text ?

F5 BIGGER SIZE !


<script>
$('[contenteditable=true]').keydown(function(e) {
if (e.keyCode == 116) {
e.preventDefault();
document.execCommand("fontSize", false, "7");
}
});
</script>
on 1597467118
Great
on 1594923301
Simple to use. Useful for correcting OCR mistakes and minor typing errors.
on 1594651956
Facilita a correção
on 1593620717
good
on 1590834807
Can you please add ability to edit fields in Preview in Browser, too. Edits are not saved in the note. This would be suuuuupppperrr helpful :) Thank you!!!
on 1589915278
It helps me a lot!
on 1588874331
Works great. Ctrl + Shift + V works for me and can paste without formatting! Amazing stuff!
on 1588300638
Works much better than the last one, Remove Formatting is something that I needed
Is it possible to bring back the 'Paste' option when I right-click, it only have the 'Copy' now
on 1587055802
This works great.

Here's a trick if you don't like how copy-pasting looks:
Press Ctrl+Shift+V on Windows to do a paste without copying the formatting. This will get rid of any strange colors and fonts and keep it copied as plaintext.

Another trick I did was I added a little symbol or indicator on the line before my Meaning/Definition field, so I know where to click in case the box for the field is blank.
on 1586133574
excellent, thank you.
on 1585537649
OMG I love u. Just it.
Comment from author before post was edited
Update. Please try this one instead - https://gist.github.com/kelciour/2491063a1244f6ea8e22396b170149a7
I set the color to blue ("#00f") - https://www.w3schools.com/colors/colors_picker.asp

<script>
$('[contenteditable=true]').keydown(function(e) {
if (e.ctrlKey && e.keyCode == 221) { // Ctrl + ]
e.preventDefault();
document.execCommand("insertOrderedList");
}
if (e.ctrlKey && e.keyCode == 82) { // Ctrl + R
e.preventDefault();
document.execCommand("removeFormat");
}
if (e.ctrlKey && e.shiftKey && e.keyCode == 66) { // Ctrl + Shift + B
e.preventDefault();
document.execCommand("hiliteColor", false, "#00f");
}
});
</script>
-------------------------------------------------
Thank you. Please try this one - https://gist.github.com/kelciour/77ba239f92b225c3771fe77035035a2a
It works the same way as Mini Format Pack - https://ankiweb.net/shared/info/295889520
on 1585482927
very useful, thank you!
on 1584530573
Works great - thanks very much. This newer version eliminated some of the conflicts I was having with the older version and ANKI 2.1.15
on 1583958420
Really really good addon! I use it all the time
on 1583508523
Thanks a lot!
on 1582765569
Perfect.
Suggestions:
- make it compatible with Replay buttons on card addon
- make it possible to permit text edition, for example, ctrl + B or change the letter color etc. during review
- make it possible to record your own voice during review
Comment from author
Thank you for the suggestions! I think, Ctrl + B should work just fine out-of-the-box, to change the letter color please see 01.01.2020, i.e. edit the card template and add this script to be able to set the letter color to blue ("#00f") by pressing F7.

<script>
$('[contenteditable=true]').keydown(function(e) {
if (e.keyCode == 118) {
e.preventDefault();
document.execCommand("foreColor", false, "#00f");
}
});
</script>

Let me know if there're any problems.

About recording your own voice, thank you, I'll give it a thought once I'll add support for clozes in the add-on but as for now I'm not sure if or when it'll be implemented.

About replay buttons on card, thank you, it's something that I'd like to add in the future, but at the moment I can only suggest to try the updated version, or maybe there's nothing much left from the original add-on and it's a completely new add-on considering all the changes, by BlueGreenMagick - Edit Field During Review (Cloze) - https://ankiweb.net/shared/info/385888438 - to be able to edit a field that contains [sound:...] tags the same way as in the Edit window.
on 1581833638
it's very convenient, thank you.
on 1581778526
Thank you. It saves a lot of time
on 1581100777
thank you!

everytime i am trying to edit the question field after exposing the answer it shows an error.

Edit:
Thanks for the answer, it worked! :)
Comment from author before post was edited
Please edit your card template and replace {{edit:FrontSide}} on the Back Template with {{FrontSide}}.
on 1580295806
Super nice Ad-on... using it all the time.

Is there a way to exchange the mouse click with an short cut for example. I experienced an error during reviewing with my controller.
It seems that sometimes it copies the last "back" part of a card to the next one and replaces it.

cheers
Comment from author
Thank you for reminding me about the issue. It should be fixed now.

About the hotkeys, Tab or Shift+Tab seems to work out-of-the-box and can be used to focus the editable field and probably optionally Esc to make it lose focus and save the changes.
on 1580122958
good
on 1579813063
Fantastic add-on!! Saves so much time in the long run. Thank you so much for your work!

Unfortunately i am not able to "undo" underline formatting.
I can underline normal text with cmd+u just fine, but then I am not able remove the underlining with cmd+u. Bolding and italic works both ways via cmd+i/b. Do you have any idea why only underline formatting works for just one direction (=adding)? (Already tried to disable all add-ons for interference purpose - did not work unfortunately)

I am running Anki 2.1.15 (Mac) and your latest add-on version.
Comment from author
That's strange. Does it work in the Edit window? And I'd very much recommend to create a new Anki profile and try it out with the default Basic note type. If it works in the Edit window and works with a new Anki profile, maybe it's something with the card template, maybe some CSS rules cause this behavior, or maybe the HTML, for example, if it contains some tags with the inline style attribute. Another thing to try is to take a look at the original HTML, then at the same HTML after using cmd+u to underline and at the same HTML after trying to "undo" underline formatting. Maybe it'll be different and might give some idea why it happens. Maybe some sample deck would be helpful too, if it's possible, so I could take a look at it.
on 1579617774
Is it possible to configure to make the text capitalized?
on 1579150711
Thanks!!!!
on 1579129187
Usefull
on 1579044198
Thank you so much for this add on, it is easily my favourite add on because I love to add edits but my computer lags every time it has to go to browse, so this add on has been a game changer.

My question was regarding if there was possibly a script I could add to be able to copy paste screenshots/images. I've added your script for removing formatting and it works beautifully, but I am still unable to copy paste images for some reason with the add on.
on 1578725904
Thanks a lot! Much love for this add-on, it is perfect. Cloze support, please!!!!!
Comment from author
Thank you. It'll definitely be added in the future. At the moment I can only suggest the updated version of the add-on by BlueGreenMagick with cloze support added - https://ankiweb.net/shared/info/385888438
on 1577878716
great for bolding texts(CTRL+B)
unfortunately coloring(F7) doesn't work
Comment from author
Thank you for the feedback! At the moment I can only suggest to manually copy-paste the following code or the same code from this gist - https://gist.github.com/kelciour/08f32dd7462dfd3a68cb7a472e07cf0b - to the end of the Front Template and/or the Back Template. There's no need to add it to the Back Template if it's been already added to the Front Template and the Back Template contains {{FrontSide}}. It'll set the foreground color to blue ("#00f") by pressing F7 (118).

<script>
$('[contenteditable=true]').keydown(function(e) {
if (e.keyCode == 118) {
e.preventDefault();
document.execCommand("foreColor", false, "#00f");
}
});
</script>

1. JavaScript Event KeyCodes - https://keycode.info
2. HTML Color Picker - https://www.w3schools.com/colors/colors_picker.asp
3. Document.execCommand() - https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand
on 1577044796
Congratulations
on 1576189043
It's a very simple, yet a very useful add-on. Thanks!
on 1574631502
thanks for the reply it worked now
Comment from author before post was edited
Please replace {{edit:FrontSide}} in the Back Template with {{FrontSide}} to fix it.

> There are some special fields you can include in your templates:
> The content of the front template (only valid in back template): {{FrontSide}}
https://apps.ankiweb.net/docs/manual.html#specialfields
on 1574061232
Awesome add-on- I've been recommending it to all of my classmates who are hardcore ankiers. However, I've been having some issues with the addon:

1. Cannot underline text (italicizing/bolding works) - not sure if this is a universal problem for people
2. Snapshotted images cannot be directly pasted in the edit field

Otherwise, everything works splendidly and has been immensely helpful with enhancing the content of my cards. If the above problems can be solved, this would become one of, if not already, the best add-ons you can have!
Comment from author
Thank you! That's really great to know!

About the first issue, I'm not sure, but at the moment I can think only of two possible reasons why Ctrl+U doesn't work:

- There's another add-on with the Ctrl+U shortcut key too. Maybe try to temporarily disable all add-ons except Edit Field During Review to make sure that underline works fine with any other add-on disabled. Or let me know what add-ons do you have installed by going to Help - About - Copy Debug Info.
- Very unlikely, but there may be some JavaScript code in the card template that overrides Ctrl+U default behavior.

Or maybe as a temporary workaround add the following JavaScript code on the Front/Back Template to toggle underline, but using the different shortcut key, for example, Ctrl+Y.

<script>
$('[contenteditable=true]').keydown(function(e){
if(e.ctrlKey && e.keyCode == 89){ // Ctrl + Y - https://keycode.info
e.preventDefault();
document.execCommand("underline");
}
});
</script>
on 1572513193
Great tool for editing , especially for deleting useless parts.
on 1572492445
You are literally god, dude! This is probably the add-on I use the most and which helps me the most. My only problem with it was the styling, so I had to paste it as plain text all the time, but then I found the script in the comments and it works perfectly. One less thing to worry and a productivity boost. Thank you very much!
on 1571459423
Excellent add-on for copy pasting definitions quickly.
I have one problem though, it seems to copy the text styling /background as well-- any way to make it just paste plain text- in my card's design ?

Here's a screenshot: http://prntscr.com/pld188 - usually if I just copy-paste the text by going Edit> 'paste' it shows the definition in proper format
Comment from author
Maybe add the following code to the end of the front/back template - https://gist.github.com/kelciour/032afc3a467803850617a0ff38f5b0cf
on 1571414374
very helpful thanks :)
on 1570872092
Good
on 1570383769
I love this addon. Is there any news on when the update to allow cloze edits will happen?
Comment from author
Maybe next weekend or a bit later.
on 1569940820
Fantastic! I add definitions while reviewing and this addon saved me a lot of time and trouble.
on 1569827485
Works perfectly, great time saver.
on 1569671568
Works great.
on 1569285343
that's very helpful! thanks dude
on 1567715452
Cracking add-on, nice one!
on 1567523314
Terrific add-on!

There is just a drawback: when there are math formulas using LaTeX, the add-on deletes the LaTeX code and saves only the image of the formula in the field.

Thanks!
on 1566760230
very useful!!
on 1564729198
Extremely practical and efficient. Never again opening the editor to make laborious editions to the same field in multiple cards!
on 1564333963
Useful add ons
on 1563831846
Best Addon!
on 1563303624
Revolutionary idea
on 1563168962
Awesome. One of my Anki-life-saver.
Tip: If you have {{edit:Tags}} in your card template, you can edit card's tag while reviewing. Very handy.
on 1562153153
It work with editing Extra in cloze cards. {{edit:extra}}. I agree it doesn't work with editing the main cloze text.
thanks
A
on 1562107157
Cloze support, please!!!!! Much love for this add-on, it is perfect. Also, it'd be useful if clickable items (e.g., hyperlinks) worked, instead of activating the editing tool.
on 1561548792
Amazing! Hopefully it will be functional with cloze cards too in the future
on 1561458746
Good, it can work fine with pop up dictionary and other add-ons. But cloze support is needed since all may note cards are cloze. Sadly, whenever I edit field it during review, I cannot view my cloze
on 1561196630
Perfect!
I often use it.
it's very convenient.
Thank you very much
on 1560680542
Thank you so much! This is a must-have addon and saved my time so much!

Although cloze support would be good to have
on 1559809571
Great add-on. Saved tons of time. Thanks.
on 1558397552
Thank you
on 1557377842
Amazing addon. One question, I'm having an issue, it seems I can't paste images into fields which are editable by adding Edit: prior to the field.
Any solutions?
on 1556987473
错误
有一个错误发生了.请在按住shift键的同时启动Anki,这样可以临时的忽略掉你已经安装的插件。
如果仅仅是因为插件引起的问题,请选择工具>插件菜单项来将出错的的插件设置成失效,然后重启Anki,重复以上的步骤直到你发现了具体是哪个插件引起的问题。
当你已经发现是因为插件引起的问题,请在我们的支持网站上 add-ons section 上报告问题。
调试信息
Anki 2.1.12 (eef86bf3) Python 3.6.7 Qt 5.12.1 PyQt 5.11.3
Platform: Windows 10
Flags: frz=True ao=True sv=1

Caught exception:
File "aqt\webview.py", line 27, in cmd
File "aqt\webview.py", line 85, in _onCmd
File "aqt\webview.py", line 363, in _onBridgeCmd
File "C:\Users\MyPC\AppData\Roaming\Anki2\addons21\1020366288\__init__.py", line 75, in myLinkHandler
saveField(note, fld, val)
File "C:\Users\MyPC\AppData\Roaming\Anki2\addons21\1020366288\__init__.py", line 59, in saveField
field = note[fld]
File "anki\notes.py", line 98, in __getitem__
File "anki\notes.py", line 95, in _fieldOrd
<class 'KeyError'>: 'FrontSide'
Comment from author
Please, replace {{edit:FrontSide}} in the Back Template with {{FrontSide}} to fix this error.
on 1556987012
best
on 1556669911
Love it! It lowers the threshold for improving the cards. Sometimes during the learning session you're not in the mood to click "edit" and fix the card, but this add-on removes the threshold.

The only problem (big problem for image-heavy learners) is that the images that you paste during a review disappear the next time the card is shown. The card shows an empty placeholder and has the title of the image, but not the image itself.
on 1555478071
Download failed. "Error downloading: 404"

Edited 1/12/18 - Pretty cool idea, but there is some limitations for me (maybe not for others). Instructions was confusing at first, but you just need to think about it. This add-on is not for anki user who is avoid of monkeying around with card code. Simply downloading the add-on will not get you anywhere. So you need to edit the card template card side in which you want editing (ie. "front" and "back" card). As the instruction says you need to replace {{Field}} with {{edit:Field}}. Field examples include {{Extra}}, {{Front}}, and {{Back}}. However it will NOT work on {{cloze:Text}}. Because most of my cards (80%) involve {{cloze:Text}}, it is quite unfortunate that I cannot edit on those. In addition, for my cards that involve the {{Extra}}, these cards are on card type that involve asking a bunch of questions on just one card type. Great for question making, but as a result, I need to edit every front/back within that card type. Overall, sweet idea but because of my card type organization this will not be a huge part of my studies unless I overlooked something about this add-on.

Edit 4/16/19 Been using this for a couple of months. Loving it. Problem I have been having is that I cannot move pictures around during review AND when editing outside review. In addition, it would be great, if there is a way to incorporate this addon to "cloze deletion" cards.
Comment from author before post was edited
Thank you for the update too! Some cloze support is on my to-do list and if everything goes well it may be added by the end of the month.

------------------------------------

It looks like you're on Anki 2.0. The add-on supports only Anki 2.1. Please upgrade to the latest version of Anki - https://apps.ankiweb.net
on 1555454535
I like it very much!
on 1555434607
Very useful
on 1555375428
Amazing one of my favorites!!! Im a medical student and 2nd thinned for the option for adding images during review. It would make my workflow in Anki way more efficient!!! Sometimes the images will paste. I don't know why. I tried changing the code in my cards but it did not help. Im using the edit add on with the hints add on.

Update!! It seems I can only copy and paste images that are in my Evernote notebooks!! Hope this helps!!

2nd update When I go to review the card the image doesn't appear sooo... it doesn't work because the image can't be seen after you paste the image. Curious that at least the image appears as if had been paste in the reviewer
on 1553922642
Thank you!
on 1552965313
This add-on is awesome and essential. Thank you very much!
Could please include a shortcut key so that we can edit the images/mp3s externally, such as through Preview/Audacity? For example, pressing F10 will immediately open the audios with Audacity or images with Previews.
Medical students frequently need to edit their images when reviewing. If the add-on supports external editing for images/mp3s, it would be great!
on 1552907217
Absolutely excellent. Thank you!
on 1551631679
This is amazing and I am using it every day.

There is only one problem...I can't paste SOME pictures. Which sucks because I mostly learn from pictures :(

For example if I use the snip tool and attempt to paste the image it doesn't work. Nothing happens -- right clicking shows there is no "paste" option. It's as if Anki is not seeing my clipboard.

However, if I right click on a WIKI image and copy I can usually paste it right into the Anki editable reviewer screen/field no problem. This isn't universal though, some images sourced from other places with either 1) right click:copy OR 2)Ctrl+C act the same way as screen clippings -- nothing happens and the paste option is absent in Anki when I right click.

Any workarounds or suggestions would be amazing.

In any case THANK YOU!!
on 1551311755
UPDATE: Downloading v 2.1 Worked! Thanks!

I am also getting the "Download failed. "Error downloading: 404"" Any tips?

i'm using a Mac. All other add-ons (including the first add=on for this tutorial are working just fine)
Comment from author before post was edited
It looks like you're using Anki 2.0. Unfortunately, the add-on doesn't work with it. Please install Anki 2.1 - https://apps.ankiweb.net
on 1551311237
This app is an absolutely great idea, but editing fields that contain images will result in you LOSING the image. Undo button does not work! Another user mentioned that it was tied to Speed Focus App but uninstalling the app does not fix the problem.

I've lost tons of images by simply CLICKING the back of a card that contains an image. I wanted this app to work so bad, its a bummer :/

UPDATE
Oh I'm so excited to say that the developer (nice guy btw very active in helping his audience) made the problem something of the past! I would love to see an automatic fix in the near future if possible! I'm willing to donate to him for helping us out, his app has saved me TONS of time especially using Pepper/Salt decks (medschoolanki).
Comment from author before post was edited
Hi there! I've updated the add-on and fixed this issue and added support for undo to be able to revert back changes from the last edit. The issue wasn't serious and you still should have your pictures in your collection.media folder as long as you didn't use Tools - Check Media - Delete Unused Files. The add-on is simple and doesn't delete anything by itself. The problem was that the add-on, instead of unescaping "foo%20bar.jpg" and saving it as "foo bar.jpg", saved HTML code as it is, i.e. as "foo%20bar.jpg". It can be easily fixed by opening and closing Edit HTML window ( https://streamable.com/ksnfk ) or let me know and I'll come up with some automatic solution to fix all the pictures this way.
on 1550942698
Very Helpful add-on!
on 1548244578
Please make the field editable even if it's empty when using 'span' rather than 'div' >.< (thank you for the response - that works!)

23/01 update: I'm getting this error after I've made my tag field editable:

Debug info:
Anki 2.1.6-beta2 Python 3.6.7 Qt 5.12.0 PyQt 5.11.3
Platform: Windows 10
Flags: frz=True ao=True sv=2

Caught exception:
File "aqt\webview.py", line 27, in cmd
File "aqt\webview.py", line 85, in _onCmd
File "aqt\webview.py", line 346, in _onBridgeCmd
File "C:\Users\David\AppData\Roaming\Anki2\addons21\1020366288\__init__.py", line 38, in myLinkHandler
reviewer.card.note()[fld] = val
File "anki\notes.py", line 101, in __setitem__
File "anki\notes.py", line 95, in _fieldOrd
<class 'KeyError'>: 'Tags'

Anki doesn't crash or anything, just the error window pops up. Any edit made to the tag field doesn't save after the error pop up.
Comment from author
24.01.2019. I've updated the add-on and added basic support for {{edit:Tags}} in the card template. Please use Tools - Add-ons - Check for Updates.

------------------------------------

As of now, it's probably better to use something like this in the Styling section of your card template:

span[contenteditable="true"]:empty {
display: inline-block;
width: 100px;
}

or maybe:

span[contenteditable="true"] {
display: inline-block;
min-width: 100px;
}
on 1547758430
Great!
on 1547544345
Amazing! I wait this idea for a long time.
Thank you very much.
on 1547321012
Decent idea. However for some reason this deletes images from a card that already has them after you are done editing the card. In addition trying to undo the action does not seem to work, as it just returns to the previous card instead of fixing the edits done to your card.

Edit: I updated my review when I realized that it wasn't necessarily your addon that caused the problems. I went back in to try and replicate the error and I realized that its a compatibility problem with another addon that I am using (Speed Focus Mode (auto-alert, auto-reveal, auto-fail)).
This is an image of the problem I am having ->https://imgur.com/a/6Ddj4eS

The problem occurs because the timer continues to run while editing (I have it set to hit again after 20 seconds). Cmd + z doesnt work in this case as it deselects the editing window and moves you along to the next card. This causes a weird issue in that it somehow dissociates that image from the card causing the above problem to occur. This doesnt seem to resolve with the Check Media or database feature (these images are all locally stored)
Another problem I noticed is that it copies the contents of the card that was being edited to the next card. I dont have an example of that as I noticed these yesterday and I fixed them already.

I want to make it clear that I do appreciate your effort in making this addon!
Comment from author
Thank you for the update! I've updated the add-on and added a fix to support Speed Focus Mode add-on and clear all timeouts (set to zero) if the field is selected (gains focus). It should fix the issues with Ctrl+Z and with "copies the contents of the card that was being edited to the next card".

By the look at the imgur image, I can't tell anything specific and I can't think of anything that will cause to make an image to be "deleted" from the card. If these images are all locally stored, Check Media should help with finding any missing images, but if it doesn't find any missing images, it probably can only mean that this image isn't locally stored and it's just a link to some picture on the Internet or maybe, but unlikely, it's base64 encoded image. This can be checked by using Edit HTML option from the Edit window - https://apps.ankiweb.net/docs/manual.html#features ("The last button shows more advanced features, such as editing the underlying HTML of a field").

------------------------------------

> However for some reason this deletes images from a card that already has them after you are done editing the card.

Can you provide some sample when it happens? I can't repeat it and usually it's better to use different fields for text and images.

> In addition trying to undo the action does not seem to work, as it just returns to the previous card instead of fixing the edits done to your card.

"During review click on the field, edit it and click outside of it or press Esc to save it, or press Ctrl+Z to undo any changes."
It means that Ctrl+Z only works when the field is active, it's been edited and it's still has focus. This is default behavior of contenteditable element when Ctrl+Z is pressed. When the field loses focus, its content will be saved and Ctrl+Z won't work anymore.

Please note that the add-on is experimental and very, very simple, its functionality is very basic and some new functionality may be added in the future, and my English may not be very good.
on 1547183911
Great app that's saving me a lot of time editing Zanki cards during my step review. Basically it works for basic cards and the extra sections in cloze deletions as of now. To edit an empty field I just have to slowly go over the note with my mouse until a text cursor comes up and then I can click it and edit it. For some reason windows snippets won't copy but regular pictures copied off of an internet browser will. For those that are anki noobs like me these were instructions I got from the dev that helped me use this add on:

"by {{Field}} I mean the name of the field in your card template, in your case it's either Front or Back field, i.e. to make, for example, Front field editable, replace {{Front}} with {{edit:Front}} in the card template.

About the cloze deletion cards, the add-on won't work with {{cloze:Text}} on the Front Template that contains some cloze deletion, but it's possible to use the add-on with {{Extra}} field, i.e. {{edit:Extra}}, on the Back Template."
Comment from author
Please note that pictures aren't supported (yet?) and any pictures copied from the internet browser won't work without internet connection. This can be fixed by using one of these add-ons:

Localize Media - https://ankiweb.net/shared/info/1293255374
Media Internalizer - https://ankiweb.net/shared/info/221033553
on 1546955740
It do benefit user. However, could you add shortcut for highlighting words with red? That will be perfect.
Comment from author
This isn't supported by the add-on (yet?) but something like this can be done by updating the Front Template and/or the Back Template with a bit of JavaScript / jQuery code.

For example, to highlight selected text with "#fd9796" color by pressing Ctrl+H (Ctrl+72) paste the following code in your card template (the Front Template or/and the Back Template). If the Back Template contains {{FrontSide}} and the Front Template already contains the code, there's no need to add it the second time. For example, https://gist.github.com/kelciour/e33e47a73e10f9cc02c06014f34923c7

<script>
$('[contenteditable=true]').keydown(function(e){
if(e.ctrlKey && e.keyCode == 72){
e.preventDefault();
document.execCommand("HiliteColor", false, "#fd9796");
}
});
</script>

Useful links:
1. JavaScript Event KeyCodes - https://keycode.info
2. HTML Colors - https://www.w3schools.com/html/html_colors.asp
3. Is this possible to write own hotkey for content editable in HTML Jquery? - https://stackoverflow.com/a/32991862
4. Document.execCommand() - https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand
on 1546834726
save me a lot of time THANK YOU
on 1546701642
a brilliant idea.