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

Place a space between certain character class letters only #1057

Merged
merged 1 commit into from Nov 27, 2023

Conversation

nobu
Copy link
Member

@nobu nobu commented Nov 27, 2023

Basis

Japanese text is not usually space-separated per words, and can be folded at almost any places except for around some punctuations.
That means, line breaks in Japanese sentences should be removed and not replaced with spaces like in English sentences.

Problem

However, RDoc blindly replaces line breaks with spaces, resulting in very unnatural gaps in Japanese text, highlighted in the screenshot below.

image

This makes it impossible to select words by double-clicking, for example.

Fix

With this patch, only line breaks between SPACE_SEPARATED_LETTER_CLASS characters will be replaced with spaces.

image

SPACE_SEPARATED_LETTER_CLASS includes Decimal_Number, Cased_Letter, and Connector_Punctuation for now, as an analog to \w.

@nobu nobu merged commit 1f568e0 into ruby:master Nov 27, 2023
19 checks passed
@nobu nobu deleted the space-with-nonascii branch November 27, 2023 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant