๐งผ Ankleen
Ankleen is a safe, one-click formatting cleaner for Ankiโs editor.
It is designed for people who import cards from CSV or generate card text with AI tools, then notice broken formatting like Markdown bold text, backtick code, or $...$ LaTeX that does not render the way they want in Anki.
Ankleen does not bulk-edit your collection. It works only on the note currently open in the editor, and it shows a preview before applying changes. โจ
โจ Features
-
๐ Converts common AI-generated Markdown into Anki-friendly HTML:
**bold** and __bold__ โ <b>bold</b>
`inline code` โ <code>inline code</code>
~~strikethrough~~ and simple ~strikethrough~ โ <s>strikethrough</s>
-
๐งฎ Fixes $...$ and $$...$$ math delimiters:
- Simple probability/set notation is converted to stable Unicode when possible.
- More complex formulas fall back to Anki-compatible MathJax delimiters.
-
๐ค Example conversions:
$P(A \cup B) = P(A) + P(B)$ โ P(A โช B) = P(A) + P(B)
$P(A \cap B)$ โ P(A โฉ B)
$P(A \mid B)$ โ P(A|B)
$A_1^2$ โ \(A_1^2\)
-
๐ Adds spacing cleanup to reduce clumped imported text.
-
๐ Shows a preview before applying changes.
-
โฉ๏ธ Includes an Undo Fix button for the most recent fix on the current note during the current Anki session.
๐ Usage
- Open a note in Ankiโs editor.
- Click Fix Formatting in the editor toolbar.
- Review the preview.
- Click Apply Fixes to update the current note.
- Click Undo Fix if you want to restore the previous field values.
๐ก๏ธ Safety Notes
Ankleen is intentionally non-destructive:
- It does not scan or modify your whole collection.
- It does not automatically modify pasted text.
- It only changes the current note after you confirm the preview.
- Undo history is stored only in memory for the current Anki session.
โ
Compatibility
Tested on:
- Anki 24.06.3
- Python 3.9.18
- Qt 6.6.2
- PyQt 6.6.1
Other versions may work, but have not been tested yet.
๐ Bugs, Ideas, and Contributions
Found a bug? Have an idea? Want to improve the formatter?
PRs, bug reports, feature requests, and suggestions are very welcome! ๐
GitHub repo: https://github.com/DontSpillTheTea/Ankleen
โ ๏ธ Limitations
Formatting cleanup is regex-based and intentionally conservative. Some complex Markdown, nested HTML, unusual LaTeX, or edge cases may not convert perfectly.
Please review the preview before applying changes.