Please read first
- This add-on was made for my own note types (LK-cloze and LK-IO). Out of the box it skips every other note type. To use it on yours, open Help β LK's fixes Settings and tick your note types and the fields each tool should read.
- Back up your collection before the first run (File β Export β Anki Collection Package).
- Tested on Anki 26.09.2. Use at your own risk.
LK's fixes
Nine small clean-up tools for your notes, under Tools β LK's fixes, plus Run All to go through them in one pass. Nothing is saved until you have seen a preview and pressed Apply, and every run can be undone with Edit β Undo.
The tools
- Cloze Fix: Anki ends a cloze blank at the first
}}, so LaTeX like \frac{W_{out}}{W_{in}} inside a blank cuts it short. This writes } } instead. It understands nested clozes and LaTeX line breaks (\\). Blanks whose braces never close are listed for you, not changed.
- Div to Line Break: rewrites
<div> lines as <br> line breaks. The field looks the same; a blank line stays one blank line.
- Fraction: turns plain-text fractions and units into inline MathJax:
m/s β \(\frac{m}{s}\), 1/2 β \(\frac{1}{2}\), 0.0821 LΒ·atm/(molΒ·K) β 0.0821 \(\frac{L*atm}{mol*K}\). It is careful on purpose: it leaves words like and/or, ratios like 50/50, anything already in MathJax, HTML tags, links and cloze markers alone.
- LaTeX check: lists every note whose MathJax or LaTeX won't display, in a window like Anki's Empty Cards (click a note id to open it in the Browser). It renders with Anki's own MathJax and settings, so
\ce{β¦} chemistry counts as fine. It only reports and never changes anything.
- Link Clean Up: moves Khan Academy and YouTube links from one field to another (Extra β Source by default) as plain URLs, one per line, and removes leftover link code such as a stray
</a>. Other links are left alone.
- NBSP to Space: replaces every non-breaking space (
) with a normal space.
- Photo Credit: removes photo-credit lines (small or italic "Photo credit: β¦" text, however it is wrapped). The image stays. Credits it doesn't recognise are listed for you to check.
- Span Formatting: removes formatting pasted in from websites on
<span> tags (fonts, sizes, colours, backgrounds). Bold, italic, underline, strikethrough, superscript and subscript stay.
- Trailing Lines Fix: deletes empty lines and empty code after the last line of text in a field.
How each tool works
- Choose what to run on: the notes selected in the Browser, a search, or the whole collection.
- A preview shows every field that would change, before and after, with the changes highlighted. Uncheck any note you want to leave alone, or press Show all in Browser to look at them first.
- Apply saves the checked notes as one undo step. A summary shows what changed, plus any notes listed for you to check by hand.
Only field text changes, never scheduling, flags, suspension, decks or review history. Fields such as ID, Image and the image-occlusion mask fields are never written. If a change would break a cloze blank, that note is skipped and listed.
Run All
Tools β LK's fixes β Run Allβ¦ asks once which notes to use, then goes through every tool that is turned on, in a sensible order (Cloze Fix first, Trailing Lines Fix and the LaTeX check last). Each tool stops at its preview so you can Apply, Skip or Stop; a tool with nothing to change is passed automatically. Afterwards it runs Anki's own Empty Cards, Check Media and Check Database, waiting for you to close each window, and ends with one summary.
Settings
Help β LK's fixes Settings lets you:
- turn each tool on or off (a tool that is off is greyed out in the menu and skipped by Run All)
- choose, per tool, which note types it runs on and which fields it reads
- choose which fields Link Clean Up moves links from and to
- tag every note a fix changes (e.g.
LK::Fixed::Fraction), off by default
- choose which of Anki's checks Run All finishes with
Light on your Anki
The add-on only loads when you use one of its tools. It does nothing while you study or edit cards.