Repository navigation
fix(ios): Copy as Markdown no longer splits bold after the first character - #1143
Open
juliusmarminge wants to merge 1 commit into
Open
juliusmarminge wants to merge 1 commit into
juliusmarminge wants to merge 1 commit into
Conversation
…acter Copying a selection like **What** from a list item gave **W****hat**: the extractor wrapped each attribute run separately, and runs also split on attributes with no inline meaning, such as the list-marker anchor on an item's first grapheme. Runs with the same inline delimiters as the segment that still ends the output now extend that span. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 9, 2026
This branch has not been deployed
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.
What/Why?
On iOS, selecting
**What**in a rendered reply and choosing Copy as Markdown pastes**W****hat**. We hit this in T3 Code's iOS app; Dan Sanduleac wrote the fix in pingdotgg#12, and this PR carries his commit unchanged.extractMarkdownFromAttributedStringwraps each attribute run in its own delimiters, and runs also split on attributes with no inline meaning.ListItemRendereranchorsListItemMarkerStartAttributeon a list item's first grapheme, so a bold lead-in such as- **What**: …arrives asW+hat. Bold around a recognized link and inline code around a link split the same way; for inline code the split changes what the pasted markdown means.Now, when a run has the same inline delimiters as the span that still ends the output, its text goes inside that span: the closing delimiters move past it instead of a new span opening. Runs with different formatting are still wrapped separately (
**a***b*), and adjacent links to different URLs stay separate.Plain Copy uses the same extractor for the markdown flavor it puts on the pasteboard, so it gets the fix too. Selecting a whole message was never affected, only partial selections.
Testing
__tests__/ios/ENRMMarkdownExtractorTests.mm: a bold run split by an unrelated attribute, bold at a list-item start, and adjacent bold/italic runs. Compiled with XCTest as a Mac Catalyst binary againstMarkdownExtractor.m: 2 of 3 fail onmain(**W****hat**,- **W****hat**: next), 3 of 3 pass with this change.- **What**: …and choosing Copy as Markdown copies- **What**.main.clang-format --dry-run --Werrorpasses.yarn turbo run test:ios).PR Checklist
Opened by Claude Opus 5.5 in Claude Code.
🤖 Generated with Claude Code