Sometimes i find my fields cluttered with useless <div></div> or random instead of simple spaces. It may be due to addons or aggressive copy-pasting or only god knows what.
Sometimes i even find something like this
I see that there is already a lot of work on this topic; what i was thinking was a simple workaround like that when you check the database (but this is just an example), an automatic process find and replace every non breaking space with a normal space…
I would recommend against automatically converting nonbreaking spaces, as they are a legitimate character with legitimate uses. We use them relatively little in English, but some languages use them much more. For example, my work is in French for a small publisher, and they are in everyday use for punctuation in French. Similarly, I do use them with Anki, and sometimes I have to go out of my way to make sure they are not wrongly converted by Anki.
I saw find-and-replace mentioned. If anybody needs a GUI text preparation tool, I created detergent.io (there’s npm package too) which allows to detect non-breaking space characters (U+00A0) and decide what to do with them; also strip HTML; also encode/decode entities (including non-breaking spaces); set the letter case, and collapse white-space — full toolkit. I originally created it to prepare text for pasting into HTML email templates but it helps me preparing text for Anki, especially lower-casing Cyrillic and German letters. Detergent is Open-Source and not monetized or tracked. I hope it helps somebody.