Remove Clozes — Cursor‑aware cloze remover

AnkiWeb addon 232855722

Removes cloze formatting around the cursor or within selections, handling nested clozes, MathJax, paste cleanup, AI hints, configurable backends, and live logs.
AI-generated summary; may contain mistakes.

note-managementformattingshortcutsclozefork-or-reupload

Open on AnkiWeb GitHub Ask about alternatives

AnkiWeb

Rating
5 (👍 5 · 👎 0)
Updated
2026-05-23
Anki versions
2.1.1~
Description language
en

Maintenance

active

  • Last update or commit was 131 days before the snapshot (2026-05-23).
  • The repository has 2 test files.

Will it work on my Anki?

Version branches
Min AnkiMax AnkiUpdated
2.1.1+2026-05-23
History across monthly snapshots

Loading…

Similar addons

AnkiSnip

Provides customizable LaTeX-aware snippets for Anki, expanding cc to cloze and fr to fraction inside MathJax, with ctrl+; tabstops and configurable settings.

card-creationformattingshortcutscloze

Rating 0 👍 0 · 👎 0 ⭐ 0 Anki 2.1.1~ Updated 2026-02-02
Edit While Reviewing 🚀

Enables in-reviewer field editing with formatting toolbar, cloze/list tools, medical spellchecker, and image resizing, configurable via settings without opening Browser or Editor.

note-managementformattingcloze

Rating 3 👍 2 · 👎 1 Anki 2.1.1~ Updated 2026-09-13

README

Remove Clozes — Cursor‑aware and Selection-based cloze remover

Install via AnkiWeb (Add-on ID 836994508)

A powerful Anki editor enhancement that removes cloze formatting around the caret or within a selection. It correctly handles nested clozes, MathJax, and can strip cloze markup from pasted content in non-cloze fields.

Features

  • Cursor-Aware: Removes only the innermost cloze enclosing the caret.
  • Selection-Based: Removes all clozes found within a selected block of text.
  • MathJax Support: Works inside MathJax elements (e.g., \({{c1::text}}\)). Handles complex MathJax with nested braces (\text{...{...}}) by using depth-aware parsing.
  • Rendered MathJax Awareness: Correctly targets clozes even when "MathJax Preview" is enabled. It escapes the Shadow DOM and maps the selection to the underlying TeX source automatically.
  • Nested-Safe: Correctly handles nested {{c1::...{{c2::...}}...}} structures.
  • Case-Insensitive: Supports both {{c1::...}} and {{C1::...}}.
  • Paste Strip: Automatically removes cloze markup when pasting into non-cloze fields.
  • Native Undo: Uses atomic operations so Ctrl+Z works perfectly.
  • Backend Mode: Choose JavaScript, Python, or Auto (MathJax-only Python) behavior.
  • AI Hints Cleanup: Automatically deletes corresponding AI hints (generated by the AI-Hints add-on) from the field when a cloze is removed.
  • Configuration UI: Built-in settings dialog for hotkeys, backend modes, and support options.
  • Support Tab: Integrated support page with QR codes for donations, and an option to mark that you have donated.
  • Live Logs: Real-time logging tab inside the config UI to monitor actions and backend modes.

Usage

  • Hotkey: Default is Ctrl+Alt+Shift+R. Customize it in the Add-on Config.
  • Caret: Place the cursor inside a cloze and press the hotkey to unwrap it.
  • Selection: Select multiple clozes and press the hotkey to remove all of them at once.
  • MathJax: Works seamlessly with rendered MathJax in the editor.
  • Paste: Pasting {{c1::text}} into a normal field (without cloze:) automatically converts it to text.
  • Backend Mode (Auto, default): Uses Python only if the selection touches MathJax; otherwise JavaScript.
  • Backend Mode (JavaScript): Always use JS (best native undo and cursor preservation).
  • Backend Mode (Python): Always use Python (avoids MathJax duplication but no native undo for selections).

Configuration

Access the configuration via Tools -> Add-ons -> Remove Clozes -> Config.

  • General Tab: Change the hotkey, toggle paste-stripping, toggle MathJax processing, and select Backend Mode (Auto/JavaScript/Python).
  • Support Tab: View QR codes for UPI, BTC, and ETH to support the developer. Includes an "I have donated" checkbox to disable automated update popups.
  • Logs Tab: View real-time log statements of editor actions and backend safe-mode steps.

Support

If you find this add-on useful, please consider supporting its development:

ko-fi

Known Issues

  • MathJax Duplication on Undo: In some Anki versions, using "Undo" after removing many clozes (e.g., "Select All") can duplicate rendered MathJax. This release strips rendered MathJax HTML from replacement content, but if you still encounter this:
    • Disable "MathJax Preview" from the card editor cog wheel.
    • Or disable "Process clozes inside MathJax elements" from the Add-on Config.
    • Or switch Backend Mode to Python or Auto.

Changelog

2026-05-23

  • AI Hints Integration: Automatically deletes corresponding AI hints (from the AI-Hints add-on) when a cloze is removed (handles single cursor-based, multi-selection, and backend Python safe-modes).
  • Logs Tab: Added a live-updating Logs tab to track startup events, config changes, and editor operations. Logs are automatically cleared on startup.
  • Modular Codebase: Split settings dialog tabs into dedicated sub-modules (config_general.py, tab_support.py) for better code organization.
  • Safe Auto-Open on Update: Auto-opens the Support tab exactly 2 seconds after Anki is fully loaded when an update is detected. Respects the "I have donated" option.

2026-04-16

  • Fixed Table Corruption: Removing clozes from within a table cell (e.g., <td>{{c1::text}}</td>) no longer breaks the table HTML structure or displaces the resulting text strings.

2026-04-10

  • Fixed Nested Cloze Removal: Placing the cursor inside a nested cloze now correctly removes the innermost cloze instead of the outermost cloze.

2026-04-01

  • Fixed MathJax < / > Escaping on Cloze Removal: Removing clozes now preserves literal < and > inside MathJax formulas, even when the formula is outside the selected text.

2026-03-17

  • Improved MathJax Support: Implemented source-aware mapping and depth-tracking parser to handle complex LaTeX formulas with nested braces (\text{...{...}}) and multiple clozes per formula.
  • Mitigated MathJax Undo Duplication: Strips rendered MathJax HTML from replacement content to reduce duplicate renders on Undo.
  • Case-Insensitivity: Added support for both lowercase {{c1:: and uppercase {{C1:: clozes.
  • New Configuration UI: Added a graphical settings window with General and Support tabs.
  • Project Refactor: Moved all core files to addon/ subfolder and improved build scripts.
  • Integrated Support: Added a Support tab in Config with QR codes and copy buttons for UPI/BTC/ETH.

2026-03-07

  • Added automatic cloze stripping for pasted content in fields that do not use the cloze: filter.
  • Made the paste cleanup configurable with strip_pasted_clozes_in_non_cloze_fields, enabled by default.

2026-02-24

Appropriate Legal Notices (Attribution)

Based on the Anki add‑on Cloze Overlapper by Glutanimate. Click here to support Glutanimate’s work.

  • “Cloze Overlapper” must link to https://github.com/glutanimate/cloze-overlapper/ per the Additional Terms.
  • The support link must point to https://glutanimate.com/support-my-work/ per the Additional Terms.

License

This project is licensed under the GNU Affero General Public License v3, with Additional Terms under Section 7 as included in LICENSE.txt.

Acknowledgments

Original work and licensing by Glutanimate (see header in addon/web/editor.js) and LICENSE.txt.