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

templates: use "word-break: keep-all" #302

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

NavyStack
Copy link
Contributor

@NavyStack NavyStack commented Aug 11, 2024

Description

In this PR, we address the handling of word breaking for CJK (Chinese, Japanese, Korean) languages within the project. Currently, the word-break property is set to normal, which functions adequately for English but may cause issues with CJK languages.

For CJK text, where words do not have clear boundaries such as spaces, setting word-break: keep-all ensures that text does not break arbitrarily. This change enhances readability and the layout of CJK text by preventing unintended line breaks within words.

Changes Made

  • Updated the word-break property from normal to keep-all to better support CJK languages.

Reason for Change (Related to #301)

In English, the difference between word-break: normal and word-break: keep-all is minimal because word boundaries are typically defined by spaces, allowing natural line breaks.

However, for CJK languages, characters do not have natural word boundaries. Using word-break: keep-all prevents unwanted line breaks within words, ensuring proper display and readability of CJK text.

This adjustment improves visual consistency and user experience for these languages.

<div style="width: 300px;"> 
    <h1>normal</h1>
    <p style="word-break: normal;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean necmollisnulla.Proin gravida velit dictum dui consequat malesuada.</p>
    
    <h1>break-all</h1>
    <p style="word-break: break-all;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean necmollisnulla. Proin gravida velit dictum dui consequat malesuada.</p>
    
    <h1>keep-all</h1>
    <p style="word-break: keep-all;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean necmollisnulla. Proin gravida velit dictum dui consequat malesuada.</p>
</div>

@tarampampam
Copy link
Owner

Could you please minimize the number of changed lines? It would be great if the PR only included the relevant changes 😉

@NavyStack
Copy link
Contributor Author

@tarampampam, Sure, we've fixed it.

We apologise for the delay in expressing our gratitude. Thank you for releasing such a magnificent project.

@NavyStack NavyStack marked this pull request as ready for review August 11, 2024 23:08
@NavyStack NavyStack requested a review from tarampampam as a code owner August 11, 2024 23:08
@tarampampam tarampampam added the type:enhancement New feature or request label Aug 12, 2024
@tarampampam tarampampam merged commit ff2c6a6 into tarampampam:master Aug 12, 2024
11 checks passed
@tarampampam
Copy link
Owner

@NavyStack Do you need these changes released immediately, or can we take our time with them?

@NavyStack
Copy link
Contributor Author

@tarampampam , Take your time.
We've already built an image and are using it.

Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants