Skip to content

fix(ios): use bufferLength instead of originalLength for contentEnd#219

Merged
hryhoriiK97 merged 1 commit intomainfrom
fix/ios-content-end-byte-offset-clamping
Apr 7, 2026
Merged

fix(ios): use bufferLength instead of originalLength for contentEnd#219
hryhoriiK97 merged 1 commit intomainfrom
fix/ios-content-end-byte-offset-clamping

Conversation

@hryhoriiK97
Copy link
Copy Markdown
Collaborator

@hryhoriiK97 hryhoriiK97 commented Apr 7, 2026

What/Why?

contentEndByteOffset is relative to the completed buffer (after InputRemend auto-completes missing delimiters), but mapByteOffset was clamping it against originalLength — which is shorter. This truncates the last character from the content range when incomplete markdown is auto-completed. Changed to use bufferLength to match contentStart, which already uses it correctly.

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

@hryhoriiK97 hryhoriiK97 merged commit eb1ef70 into main Apr 7, 2026
5 checks passed
@hryhoriiK97 hryhoriiK97 deleted the fix/ios-content-end-byte-offset-clamping branch April 7, 2026 13:18
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