Remove non-breaking spaces

A discussion recently came up where Anki鈥檚 frequent insertion of  s (non-breaking spaces) is causing a number of formatting issues with respect to card content wrapping to the viewable window, particular on smaller mobile devices. Unfortunately, it seems that while the Anki team is aware of the issue, there are no easy fixes they can implement as discussed here: Unexpected non breaking space inserted after using mathjax or latex shortcuts in editor 路 Issue #1053 路 ankitects/anki 路 GitHub

As a syncing platform of its own, AnkiHub could solve this issue for users in one of two ways:
(1) On upload of new cards or changes, automatically replace all  s with spaces in the database. This can easily be done server-side by whatever API endpoint is used to make submissions. These changes would then be applied to all new users on their next sync - for the submitting user, there would need to be a way to guarantee these change are synced as well.
(2) Have the add-on automatically perform the same replacement each time the app is synced with AnkiHub

Potential issues:

(1) Such changes should somehow be 鈥渁utomatic鈥 without requiring maintainer approval, as this would add a lot of noise to otherwise important content changes. For this reason, having the server handle it rather than the add-on is preferred.
(2) There could be valid use cases for   with Anki but I have yet to run into any instances where this was the case or where the non-breaking formatting was necessary. Having done a Find & Replace to convert them all the spaces in my own deck, I鈥檝e had no issues.
(3) If the deck maintainer decides they don鈥檛 want this being automated, the option to disable the feature can be considered. Referencing issue #2 though, I鈥檓 not sure this is really needed.

2 Likes

There鈥檚 an addon that does this.
https://ankiweb.net/shared/info/1676672391

I鈥檝e removed the vast majority from the deck just now and pushed those changes to AnkiHub officially. All changes can be seen in the changelog.

The remainder can be removed once the image replacement project is complete.

I wanna bump this up again now that the image replacement project is complete. Anytime anyone sends in edits more of these are created

Is there a way to have AnkiHub automatically remove them?

3 Likes

One idea I had is to perhaps just clean them as suggestions are made to AnkiHub. Then we just need to do a one time cleansing and they won鈥檛 be reintroduced like last time