Page MenuHomePhabricator

Implement syntax highlight for U+00A0 (no-break space, nbsp)
Open, MediumPublic


CodeMirror already makes a syntax highlight for U+00AD (soft hyphen). A soft hyphen in the wikitext is shown as red bullet.

It would be nice to have a syntax highlight for U+00A0 (no-break space, nbsp), too. A suggested visualization is a gray background color for the space character. This visualization is also used in LibreOffice Writer.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 394385 had a related patch set uploaded (by Fomafix; owner: Fomafix):
[mediawiki/extensions/CodeMirror@master] [WIP] Add syntax highlight for special characters

Fomafix renamed this task from Implement syntax highlight for U+00A0 (no-break space, non-breaking space, nbsp) to Implement syntax highlight for U+00A0 (no-break space, nbsp).Dec 2 2017, 12:22 PM
Fomafix claimed this task.
Fomafix updated the task description. (Show Details)
TBolliger added a subscriber: TBolliger.

Potential alternate fix: add a CSS class and let users individually set their personal CSS to highlight it

The highlight of special characters should enabled and disabled by a ¶ button.

This seems reasonable: most pages shouldn't have invisible non-breaking spaces anyway, so making them visible shouldn't disturb editors.

I played with cm-show-invisibles and it was very easy to integrate.

Screenshot 2019-03-19 at 12.05.23.png (1×2 px, 582 KB)

However, like in most editors, showing all invisibles is also very annoying when you actually want to read what you are editing. So either we need to only show very specific invisble characters other than, space and enter, or we need a toolbar button to toggle showing them (like we have in CodeEditor).

Draceane triaged this task as Medium priority.Nov 24 2020, 4:52 PM

Removing task assignee due to inactivity, as this open task has been assigned to the same person for more than two years (see the emails sent to the task assignee on Oct27 and Nov23). Please assign this task to yourself again if you still realistically [plan to] work on this task - it would be welcome.
(See for tips how to best manage your individual work in Phabricator.)

This would be extremely helpful for Russian Wikipedia where all   are replaced with a symbol by an automatic instrument (Wikificator) that is enabled by default. The lack of such highlighing is the root of many disputes that are easily avoidable. (The most recent is today.)