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

feat: enhance text splitting with Intl.Segmenter support #5942

Conversation

mRcOol7
Copy link

@mRcOol7 mRcOol7 commented Oct 7, 2024

📑 Summary

This PR enhances the text splitting functionality by incorporating support for Intl.Segmenter. This improvement allows for more accurate segmentation of text into graphemes and words, providing a better user experience in applications that require text manipulation.

Resolves #4408

📏 Design Decisions

The implementation utilizes Intl.Segmenter to split strings into graphemes and words more effectively than previous methods. If Intl.Segmenter is not available, it falls back to traditional character and space-based splitting. This ensures compatibility across different environments and improves overall performance.

📋 Tasks

Make sure you

  • 📖 have read the contribution guidelines
  • 💻 have added necessary unit/e2e tests.
  • 📓 have added documentation. Make sure MERMAID_RELEASE_VERSION is used for all new features.
  • 🦋 If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

Copy link

changeset-bot bot commented Oct 7, 2024

⚠️ No Changeset found

Latest commit: 5de21c4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added the Type: Enhancement New feature or request label Oct 7, 2024
Copy link

netlify bot commented Oct 7, 2024

Deploy Preview for mermaid-js failed.

Name Link
🔨 Latest commit 5de21c4
🔍 Latest deploy log https://app.netlify.com/sites/mermaid-js/deploys/6704ca9f7046880008b6de9b

Copy link

pkg-pr-new bot commented Oct 7, 2024

Open in Stackblitz

pnpm add https://pkg.pr.new/mermaid-js/mermaid@5942
pnpm add https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/layout-elk@5942
pnpm add https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/mermaid-zenuml@5942
pnpm add https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/parser@5942

commit: 238e1a4

Copy link

codecov bot commented Oct 7, 2024

Codecov Report

Attention: Patch coverage is 0% with 49 lines in your changes missing coverage. Please review.

Project coverage is 4.66%. Comparing base (86a9159) to head (238e1a4).

Files with missing lines Patch % Lines
packages/mermaid/src/rendering-util/splitText.ts 0.00% 49 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           develop   #5942      +/-   ##
==========================================
- Coverage     4.67%   4.66%   -0.01%     
==========================================
  Files          373     373              
  Lines        51680   51696      +16     
  Branches       586     586              
==========================================
  Hits          2414    2414              
- Misses       49266   49282      +16     
Flag Coverage Δ
unit 4.66% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/mermaid/src/rendering-util/splitText.ts 0.00% <0.00%> (ø)

Copy link

argos-ci bot commented Oct 7, 2024

The latest updates on your projects. Learn more about Argos notifications ↗︎

Waiting for the first build to start…

@sidharthv96
Copy link
Member

This PR does absolutely nothing mentioned in the description. It just adds a bunch of comments, probably by an LLM, and downgrades dependencies.

Seems like Hacktober fest has started.

@sidharthv96 sidharthv96 closed this Oct 8, 2024
@sidharthv96 sidharthv96 added spam and removed Type: Enhancement New feature or request labels Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mindmap with a node over a certain length causes an infinite loop
2 participants