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

Properly handle unicode and grapheme clusters #26

Merged
merged 3 commits into from
Oct 1, 2024
Merged

Conversation

terror
Copy link
Owner

@terror terror commented Oct 1, 2024

This PR addresses issues with Unicode and grapheme cluster handling in the markdown parsing and presentation logic.

To summarize the changes:

  • Replaced character-based operations with grapheme-aware logic using the unicode-segmentation crate.
  • Updated RopeExt trait to use byte-based operations for better Unicode compatibility.
  • Modified the parser to correctly handle grapheme clusters in code block fence detection.
  • Adjusted diff application to work with byte offsets instead of character offsets.
  • Added integration tests for complex Unicode scenarios.

@terror terror enabled auto-merge (squash) October 1, 2024 22:30
@terror terror merged commit bc59418 into master Oct 1, 2024
2 checks passed
@terror terror deleted the handle-graphemes branch October 1, 2024 22:32
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.

1 participant