Skip to content

feat(ios): copy selected markdown as verbatim source - #720

Draft
maksg wants to merge 2 commits into
mainfrom
ios-copy/01-source-offsets
Draft

feat(ios): copy selected markdown as verbatim source#720
maksg wants to merge 2 commits into
mainfrom
ios-copy/01-source-offsets

Conversation

@maksg

@maksg maksg commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

What/Why?

Testing

PR Checklist

  • Code compiles and runs on iOS
  • Code compiles and runs on Android
  • Updated documentation/README if applicable
  • Ran example app to verify changes
  • E2E tests are passing
  • Required E2E tests have been added (if applicable)

maksg and others added 2 commits August 27, 2026 14:15
Partial-selection Copy as Markdown now returns a byte-faithful slice of
the original source instead of a normalized reconstruction. A Swift-side
SourceOffsetAnnotator maps text nodes (including escapes and structural
thematic breaks) to UTF-8 byte ranges after parsing, the renderer copies
them onto runs and attachment characters, and the extractor unions the
selected runs' ranges, expands over adjacent syntax (inline markers,
block prefixes, code fences, table rows, image syntax, setext
underlines), and re-validates every slice by parsing it — any mapping
defect falls back to reconstruction, never wrong clipboard content.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Fold image handling into EdgeTrait and share one marker-consumption
loop between both slice edges, extract line-boundary helpers, reuse
the extractor's InlineTraits and invisible-character set instead of
re-deriving them, tag runs through one shared helper, and carry the
rendered source and its parse flags as a single RenderedSource value
so they can never pair up stale. No behavior change.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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