Ankleen: Fix AI Markdown and LaTeX Formatting

AnkiWeb addon 955401195

Cleans the open note in Anki's editor with a preview, converting AI-generated Markdown and dollar-delimited LaTeX into HTML, Unicode, or MathJax, with undo support.
AI-generated summary; may contain mistakes.

formatting

Open on AnkiWeb GitHub Find alternatives

AnkiWeb

Votes
0 (๐Ÿ‘ 0 ยท ๐Ÿ‘Ž 0)
Updated
2026-05-07
Anki versions
24.11~
License
Not found (this does not mean that the addon has no license)
Virus scan
No ClamAV match A match does not prove malware. No match does not prove that the code is safe.
Languages
Python, JSON
Description language
en

Maintenance

active

  • Last update or commit: 2026-05-07 (178 days before the snapshot).
  • Test files: 1.
  • Commits in the last year: 11.
  • Issues: 0 open, 0 closed.
  • Pull requests: 0 open, 0 merged.

Will it work on my Anki?

Version branches
Min AnkiMax AnkiUpdated
24.06.324.11+2026-05-07
History across monthly snapshots

Loadingโ€ฆ

Similar addons

Gemini LaTeX Fixer

Converts dollar-sign LaTeX from AI text into Anki's MathJax format automatically on paste, and bulk-converts existing collections via a Tools menu item.

card-creationnote-managementformatting

4 votes 30% approval ๐Ÿ‘ 3 ยท ๐Ÿ‘Ž 1 Anki 2.1.66~ Updated 2026-03-05
Auto Markdown - fix version archived fork

Converts note fields between Markdown and HTML, either automatically on focus changes or manually via a shortcut, while preventing editing of the generated HTML.

formattingobsoletefork-or-reupload

11 votes 52% approval ๐Ÿ‘ 9 ยท ๐Ÿ‘Ž 2 โญ 10 Anki 2.1.49~ Updated 2021-06-19
Auto Markdown has 2 forks โ†’

Converts fields between Markdown and HTML automatically on focus change or manually via a configurable shortcut, while preventing editing of the generated HTML.

formatting

42 votes 56% approval ๐Ÿ‘ 30 ยท ๐Ÿ‘Ž 12 โญ 36 Updated 2019-06-18

Description

๐Ÿงผ 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

  1. Open a note in Ankiโ€™s editor.
  2. Click Fix Formatting in the editor toolbar.
  3. Review the preview.
  4. Click Apply Fixes to update the current note.
  5. 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.

README

Ankleen

Ankleen is a safe, non-destructive, one-click editor tool for Anki that automatically fixes AI-generated Markdown and converts $ ... $ / $$ ... $$ LaTeX delimiters into simple Unicode or Anki-compatible MathJax.

Features

  • Markdown Cleanup: Safely converts **bold**, __bold__, ~strikethrough~, and `inline code` to standard Anki HTML tags.
  • LaTeX Math Fixes: Replaces generic $ delimiters with native Anki \( and \[ syntax, or drops them entirely in favor of plain Unicode for simple probability/set formulas (e.g. \cup -> โˆช).
  • Visual Spacing: Automatically normalizes spacing by replacing single line breaks with double line breaks (<br><br>) to prevent text clumping.
  • Preview & Undo: Generates a visual HTML diff preview to confirm changes. If you make a mistake, simply click "Undo Fix" to restore the previous state of the fields.

Installation

  1. Go to the Releases tab (or download the .ankiaddon file directly).
  2. Double-click the ankleen.ankiaddon file to install it into Anki.
  3. Restart Anki.

Usage

  1. Open any note in the Anki Editor.
  2. Click the "Fix Formatting" button in the top formatting toolbar.
  3. Review the diff preview pop-up and click Apply.
  4. If you want to revert the changes, click "Undo Fix".

Development

To build the add-on package locally from source:

  1. Clone this repository.
  2. Run the included build.ps1 script (or manually zip the contents of the src directory into an .ankiaddon file).
  3. The resulting .ankiaddon file will be generated in the root directory.