Skip to content

Fix adjacent blockquotes merging into one#1385

Open
ettyxne wants to merge 1 commit into
overtake:masterfrom
ettyxne:fix/blockquote-merging
Open

Fix adjacent blockquotes merging into one#1385
ettyxne wants to merge 1 commit into
overtake:masterfrom
ettyxne:fix/blockquote-merging

Conversation

@ettyxne
Copy link
Copy Markdown

@ettyxne ettyxne commented May 12, 2026

Adjacent blockquotes collapse into a single block when typing or pasting.

Root cause: TextInputTextQuoteAttribute.isEqual compared only the collapsed field, so two non-collapsed quotes were considered equal. NSAttributedString merges adjacent attribute runs with equal values — that's what caused the collapse.

Fix: Remove the isEqual override. NSObject's identity-based equality ensures each quote block stays distinct regardless of its collapsed state.

quoteRangesEqual is updated to compare .collapsed directly instead of calling isEqual, which would otherwise always use identity comparison and return false even for structurally identical ranges, causing unnecessary attribute refreshes.

TextInputTextQuoteAttribute.isEqual compared only the collapsed field,
so two non-collapsed quotes were considered equal. NSAttributedString
merges adjacent runs with equal attribute values, which collapsed all
adjacent blockquotes into a single block.

Remove the isEqual/hash overrides so NSObject's identity comparison is
used — each TextInputTextQuoteAttribute instance is distinct regardless
of its collapsed state.

Also update quoteRangesEqual to compare .collapsed directly instead of
calling isEqual, which after this change would always use identity and
return false even for structurally identical ranges.
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