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

Prevented mid-word cuts for readability #1922

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

dvlop
Copy link

@dvlop dvlop commented Oct 21, 2024

Description

Prevented cutting words in the middle when limiting the text length. Instead of a hard character limit, the string is now truncated at the first space after reaching the limit, ensuring a more natural text display.

Benefits

Doesn't cut off SHORTCODE for example

Possible drawbacks

Perhaps there is no space in the string, so it will show it in full and not with the hardcoded 160 limit

Applicable issues

Checklist

  • I have created a specific branch for this pull request before committing, starting off the current HEAD of development branch.
  • I'm submitting to the development, feature/hotfix/release branch. (Do not submit to the master branch!)
  • This pull request relates to a specific problem (bug or improvement).
  • I have mentioned the issue number in the pull request description text.
  • All the issues mentioned in this pull request relate to the problem I'm trying to solve.
  • The code I'm sending follows the PSR-12 coding style.

Prevented cutting words in the middle when limiting the text length. Instead of a hard character limit, the string is now truncated at the first space after reaching the limit, ensuring a more natural text display.
@dvlop dvlop marked this pull request as ready for review October 21, 2024 10:31
@dvlop dvlop requested a review from ojopaul as a code owner October 21, 2024 10:31
@stevejburge
Copy link
Member

Thanks @dvlop

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

Successfully merging this pull request may close these issues.

2 participants