godotengine / godotengine/godot-docs

Automatically convert spaces to non-breaking spaces where necessary around punctuation

Open
#3,600 2 comments 0 reactions 0 assignees View on GitHub
content:website enhancement
Dominant language
reStructuredText
Stars
5.7k
Forks
3.8k
Avg merge
1d 20h
Merged PRs (30d)
25

Description

This is about themeing / JavaScript improvements to the content.

In French, we use [non-breaking spaces](https://en.wikipedia.org/wiki/Non-breaking_space) before and after some punctuation elements, notably:
- Unbreakable space before `? ! ; : »`.
- Unbreakable space after `«`.

Wikipedia says it should be a "narrow non-breaking space" ` `, in 2000 when I was writing websites I used ` `, not sure what's the standard but either would do - the most important is that these punctuation signs don't end up separated from the preceding word (or following word for `«`) when the line wraps. I.e. avoid this:
![Screenshot_20200527_164816](https://user-images.githubusercontent.com/4701338/83035551-e4c64300-a039-11ea-876b-74d880a0f4d1.png)

I think other languages might also have similar requirements.

Asking translations to use those is a bit difficult, as there's no easy way to input them on most keyboards, and they're not easy to distinguish from a plain ascii space either.

So I suggest doing a search and replace as a post-processing step in JavaScript. Can something like this be done? CC @Calinou @pycbouh

We might also want to extend this to other typographical improvements, such as replacing `...` with `…`, but that might warrant discussion and properly listing all cases we want to handle. I'd suggest starting with the nbsp's as they're quite important.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.