Anki add-on: Remove Clozes — Cursor‑aware cloze remover

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: 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 Fixed paragraph/newline loss when removing a cloze at the start of a line. Improved undo stability. Added compatibility for Edit Field During Review (Cloze) . 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 .

GitHub repository: athulkrishna2015/remove-clozes-cursor-aware-cloze-remover
Repository description: A small Anki editor enhancement that removes cloze formatting around the caret, correctly handling nested clozes and optional hints while preserving inline formatting and native undo support.
Languages: JavaScript, Python, HTML