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

Use non-breaking space for unit separator #80

Open
nox-4O4 opened this issue May 19, 2023 · 1 comment
Open

Use non-breaking space for unit separator #80

nox-4O4 opened this issue May 19, 2023 · 1 comment

Comments

@nox-4O4
Copy link

nox-4O4 commented May 19, 2023

Currently, a plain space is used for separating unit and number string. This may lead to the unit wrapping to a new line:

image

While this can easily be worked around using CSS styling or a custom wrapper, it would be nice if this module used a non-breaking space to separate the unit.

@sindresorhus
Copy link
Owner

I'm willing to add an opt-in option for this, but non-breaking space can cause other problems. For example, if you use it in a CLI app and some tool tries to parse the output, they would not expect a non-breaking space.

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

2 participants