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

Invisible character (​) in package names #130

Open
darkred opened this issue Mar 22, 2021 · 6 comments
Open

Invisible character (​) in package names #130

darkred opened this issue Mar 22, 2021 · 6 comments

Comments

@darkred
Copy link

darkred commented Mar 22, 2021

I've noticed that there is this invisible character (​) in package names.
For reference:

It's the Unicode Character 'ZERO WIDTH SPACE' (U+200B) .

this character is intended for line break control; it has no width, but its presence between two characters does not prevent increased letter spacing in justification

It occurs in words that are "combinations", e.g. SublimeLinter -> Sublime + Linter
Examples pages:

Just open the 1st one, rightclick the "SublimeLinter" title and press Inspect :

screenshot

2021-03-22_184439

If you select that text in your browser and press Copy (Ctrl+C)
then the copied string "Sublime​Linter" contains the hidden character: screenshot.
[if you doubleclick the above string you'll notice that you can select only either 'Sublime' or 'Linter']
and that leads to getting no results when using it to search for the package in Sublime Text's Package Control manager.

e.g. I have installed SublimeLinter.
If I open ST3 Preferences | Package Control | List Packages
and paste the string "Sublime​Linter" (with the hidden character) I'll get no results.

Using ST3 3211 x64 on win10.

@wbond
Copy link
Owner

wbond commented Mar 22, 2021

This is on purpose, as it allows long package names to wrap on small screens. https://github.com/wbond/packagecontrol.io/blob/master/app/templates/helpers/word_wrap.py

@wbond
Copy link
Owner

wbond commented Mar 22, 2021

This pattern is used on various online docs by various organizations, since they also run into long identifiers without spaces.

@darkred
Copy link
Author

darkred commented Mar 22, 2021

Thanks for replying.

I mentioned this, hoping that maybe it could be possible to remove it without breaking things.
I see that's not possible, i.e. that's necessary, so I'm closing this.

PS. For anyone interested, here is a userscript that removes the hidden character from the package title:

// ==UserScript==
// @name         packagecontrol.io - remove invisible character in package name
// @match        https://packagecontrol.io/packages/*
// @grant        none
// ==/UserScript==

var re = /\u200B/g;
var packageTitle = document.querySelector('#content > h1');
packageTitle.innerHTML = packageTitle.innerHTML.replace(re, '');

@darkred darkred closed this as completed Mar 22, 2021
@wbond
Copy link
Owner

wbond commented Mar 22, 2021

I haven't checked recently, perhaps there is a more modern CSS method that we can use now in 2021? This was originally added in probably 2014/2015.

@darkred
Copy link
Author

darkred commented Mar 22, 2021

That would be great!

@wbond wbond reopened this Mar 22, 2021
@FichteFoll
Copy link
Contributor

Apparently, the <wbr> element should be used to suggest word break locations https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Text/Wrapping_Text#the_wbr_element.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants