As an alternative solution to T5461, non-breaking spaces should be added automatically by Mediawiki on page render in appropriate places:
- After numbers, so that "100 km" stays together
- Before dashes (like http://en.wikipedia.org/wiki/Template:Ndash )
- etc. – more examples: https://en.wikipedia.org/wiki/Wikipedia:Manual_of_Style#Non-breaking_spaces
Don't worry too much about false positives, since an extra non-breaking space won't cause any serious problems unless many of them occur on the same line.