Fix for nbsp on mobile

I know this has long been a bug in your ear @dae and it seems like there’s not an optimal solution on desktop. This really only becomes an issue for me (and I assume most people) on mobile because of the decreased screen width. Would it be possible to include an option in settings to treat all   as just a regular space so it doesn’t line break in the middle of words? If it’s an option that can be toggled, then if it’s causing formatting issues for some they could turn it off?

2 Likes

Mapping non-breaking spaces to spaces can break layout for users who actually need the non-breaking part. But if you don’t need it, a find&replace in the browse screen will allow you to change all the existing ones in one go.

2 Likes

That’s what I’ve been doing. But they always get re-introduced and then you have to keep doing that. Having them just ignored on mobile would mean you’d never have to worry about it. You could have that setting off by default so it doesn’t cause issues?

They shouldn’t be reintroduced unless you’re making edits. A simple stop-gap solution would be an add-on that strips them as notes are saved - it would be pretty trivial to write.

The problem is we’ve now introduced a way for lots of people to be making edits to a deck and re-introduce these :joy:

If you’re referring to AnkiHub, your add-on could add an optional transform as edits are sent there or received from there.

With it being a common issue for everyone would it not make sense to just build this into Anki? As an option of course so it doesn’t alter things if people are having formatting issues

Stripping them is a hack rather than a proper solution. We may be able to get better results by changing the way whitespace is applied to the editor, and it’s something I’d like to look into at one point.

2 Likes