MathJax NBSP Cleaner: Auto Removing of "&nbsp" from Notes

AnkiWeb addon 126852831

Automatically detects and converts stray   characters in MathJax fields back to normal spaces on focus-out, including dynamically generated, shadow DOM, and iframe editors.
AI-generated summary; may contain mistakes.

formattingbugfix-workaround

Open on AnkiWeb Ask about alternatives

AnkiWeb

Votes
0 (👍 0 · 👎 0)
Updated
2026-10-10
Anki versions
25.09~
Description language
en

Maintenance

active

  • Last update or commit: 2026-10-10 (22 days before the snapshot).

GitHub

No GitHub repository linked.

Will it work on my Anki?

Version branches
Min AnkiMax AnkiUpdated
25.09+2026-10-10
History across monthly snapshots

Loading…

Similar addons

Fix MathJax in Cloze

Fixes cloze conflicts by replacing internal }} with } }, handling trailing braces and nested clozes, and removing non-breaking spaces inside MathJax, with browser and reviewer bulk-fix actions.

note-managementformattingclozebugfix-workaround

1 votes 21% approval 👍 1 · 👎 0 ⭐ 0 Anki 2.1.1~ Updated 2026-04-20
Updated   remover

Removes HTML non-breaking spaces from Anki notes, replacing them with normal spaces automatically on newly added notes and optionally collection-wide via menu, shortcut, or startup purge.

note-managementformattingshortcuts

3 votes 44% approval 👍 3 · 👎 0 ⭐ 0 Anki 25.09.2~ Updated 2026-02-17
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

Description

MathJax NBSP Cleaner: Clean MathJax Formatting Automatically

When writing MathJax equations or editing formatted text, Anki's editor frequently writes double spaces into literal   strings. This corrupts MathJax rendering and clutters formulas - incredibly frustrating when using LaTeX inside cards!

MathJax NBSP Cleaner silently runs in the background of your card editor, automatically detecting and converting   characters back into normal spaces every time a field loses focus (before MathJax rendering triggers) by directly injecting raw HTML data.

Key Features

  • Automatic Focus-Out Cleaning: Sanitizes fields immediately upon unfocusing (focusout), right before MathJax re-renders your note preview.
  • Targeted MathJax Correction: Specifically targets escaped   artefacts to restore proper LaTeX/MathJax expressions without altering unintended elements.
  • Deep Field Detection: Traverses regular DOM elements, shadow roots (Shadow DOM), and nested iframes to ensure every editor field is monitored simultaneously.
  • Dynamic Field Monitoring: Uses a MutationObserver to immediately attach cleaners to any dynamically generated fields without requiring an editor reload.
  • Native Change Dispatch: Emits native input events directly to the editor after sanitising, ensuring Anki registers and saves the corrected text instantly.
  • Duplicate Prevention: Built-in script and listener flags prevent duplicate observers and multi-firing event handlers.

Usage

No configuration, shortcuts, or menus required. Install the add-on, restart Anki, and edit your MathJax notes as usual—the cleaner functions completely automatically in the background.