Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Special characters: whitespace is not displayed #5156

Closed
julen opened this issue Aug 25, 2016 · 2 comments
Closed

Special characters: whitespace is not displayed #5156

julen opened this issue Aug 25, 2016 · 2 comments
Assignees

Comments

@julen
Copy link
Contributor

julen commented Aug 25, 2016

If admins specify an space character as part of their special characters, this is not displayed in the editor.

Technically this is part of the DOM and it is rendered, but its styling differs from the rest of the characters. Does anyone have any suggestions on how to depict the whitespace in this context?

Note this will come handy especially for Japanese translators, for whom it is easier to type full-width spaces while using an IME, but at the same time they use regular spaces (\u0020) in translations.

@julen julen changed the title Whitespace is not displayed Special characters: whitespace is not displayed Aug 25, 2016
@unho
Copy link
Member

unho commented Aug 25, 2016

This can be an approach: https://blog.codinghorror.com/whitespace-the-silent-killer/

Not that I am a fan.

@iafan
Copy link
Contributor

iafan commented Aug 25, 2016

Currently spaces, if they are inserted into special characters strings in language settings, are rendered as:

<span class="extraspace"> </span>

Probably this was a feature to allow for visual separation of special symbols in the editor, but I'm not sure if this is actively used or important, and whether we want to drop it in favor of being able to specify spaces as insertable symbols. My understanding is also that the latter is really useful function for CJK and more important than mere visual enhancement.

So if we treat spaces as regular insertable symbols, they would need to be rendered as:

<a class="editor-specialchar js-editor-copytext" data-string=" " title="Insert space symbol into the editor">&nbsp;</a>

(note that for display purposes we use &nbsp; while data-string=" " attribute contains a regular space, and use special title attribute value to indicate the nature of the symbol).

I checked this and it inserts space properly.

@julen julen self-assigned this Aug 29, 2016
@julen julen closed this as completed in 07104c7 Aug 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants