Fix text not serializing correctly when having utf8 boundaries#170
Closed
bnchi wants to merge 1 commit intowooorm:mainfrom
Closed
Fix text not serializing correctly when having utf8 boundaries#170bnchi wants to merge 1 commit intowooorm:mainfrom
bnchi wants to merge 1 commit intowooorm:mainfrom
Conversation
|
Hi there, Any chance to merge it? |
Contributor
Author
|
I'm just waiting on the maintainers to review and merge this. |
Owner
|
I missed/forgot about this. Will get to it soon! |
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an issue where text was not serialized correctly when encountering UTF-8 boundaries. It adds a new test to verify proper handling of UTF-8 characters and updates state management to correctly handle multi-byte character slicing.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| mdast_util_to_markdown/tests/roundtrip.rs | Added a new test ensuring correct serialization of UTF-8 text. |
| mdast_util_to_markdown/src/state.rs | Updated character slicing to correctly extract the last UTF-8 character. |
Comment on lines
+408
to
+409
| "should support utf8 in boundries when serializing" | ||
| ); |
There was a problem hiding this comment.
Spelling error: please change 'boundries' to 'boundaries' for clarity.
Suggested change
| "should support utf8 in boundries when serializing" | |
| ); | |
| "should support utf8 in boundaries when serializing" |
|
I just found another case which is not resolved with suggested fix: let doc = "я_𝄞";
assert_eq!(to(&from(doc, &Default::default()).unwrap()).unwrap(), doc); |
Owner
|
Found them, thanks! :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #169