Repository navigation
fix(ios): preserve script semantics when copying Markdown - #849
Merged
eszlamczyk merged 2 commits intoSep 22, 2026
Merged
Conversation
…ings to constants
eszlamczyk
approved these changes
Sep 21, 2026
eszlamczyk
left a comment
Collaborator
There was a problem hiding this comment.
Hi @juliusmarminge thanks for the pull request! Confirmed the root cause and the fix as working. This matches now the Android/Swift implementation and will be included in next release.
Approving this, few non-blocking notes below though.
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?
Closes #847.
iOS partial-selection "Copy as Markdown" inferred script formatting from the sign of
NSBaselineOffsetAttributeName. Paragraph line-height alignment also uses that attribute, so ordinary bold text could copy as**^bold^**rather than**bold**.Add the private
ENRMScriptAttributeNameto the existing baseline-shift attributes, mark spans inSubscriptRendererandSuperscriptRenderer, and read those marks inMarkdownExtractor. Visual baseline calculations are unchanged. The implementation is the five-file semantic fix from the downstream integration draft, adapted to the upstream monorepo.Coverage stays with the existing examples and tests:
No parser isolation, public API, or product-specific native behavior is included.
Testing
Passed locally on Linux:
yarn typecheckyarn lint, with one existing inline-style warning in the web rendereryarn test --runInBand: 6 suites, 39 testsyarn prepare: module, types, and native codegenclang-format --dry-run --Werrorfor the five changed Objective-C filesAdditional example TypeScript diagnostics encounter existing example configuration/type errors. A targeted compiler diagnostic with the original playground source substituted produced the same 11 errors as the changed source. That separate diagnostic is not claimed green; the required library typecheck above passes.
The initial upstream CI run requires maintainer authorization for this fork contribution and has not run its checks. Native XCTest, SwiftLint, and the new Maestro flow have not been run from this upstream checkout. They require macOS/a coordinated simulator. No device, server, or remote build was started for this PR. The downstream patch was previously built on iOS and Android, and iOS partial-selection copy of bold was verified as
**bold**, as recorded in the linked integration draft. That evidence is for the downstream patch, not a fresh run of this PR.To run the focused native cases on a coordinated simulator:
After rebuilding the React Native example with this change, run the Objective-C clipboard flow:
PR Checklist
Model: GPT-6. Harness: Codex.