Skip to content

refactor(android): reuse one flag for top-priority exclusive spans - #981

Merged
jnowakow merged 2 commits into
mainfrom
refactor/android-span-priority-flag
Oct 14, 2026
Merged

jnowakow merged 2 commits into
mainfrom
refactor/android-span-priority-flag

Conversation

@jnowakow

Copy link
Copy Markdown
Collaborator

What/Why

Follow-up to #938, addressing its review comments (1, 2).

#938 set HeadingSpan with Spanned.SPAN_EXCLUSIVE_EXCLUSIVE or Spanned.SPAN_PRIORITY, the same value as SPAN_FLAGS_CONTAINER_BACKGROUND. This PR renames that constant to the more generic SPAN_FLAGS_EXCLUSIVE_EXCLUSIVE_PRIORITY and uses it in both places.

  • SpanFlags.kt: rename and generalize the doc comment. It now covers both uses: a block span that must not override its inline spans (heading) and a container background that must sit under inline pills (blockquote).
  • HeadingRenderer.kt: use the constant.
  • BlockquoteRenderer.kt: use the renamed constant. The blockquote-specific reason now lives in a comment at the call site.

The changes go into both react-native-enriched-markdown and the standalone enriched-markdown-android. The flag values don't change, so rendering doesn't either.

Testing

  • ktlintCheck and compileDebugKotlin pass for :react-native-enriched-markdown and the standalone :ui module.

PR Checklist

  • Code compiles and runs on iOS: not applicable, Android-only change.
  • Code compiles and runs on Android
  • Updated documentation/README if applicable: not applicable, internal refactor.
  • Ran example app to verify changes: not run, flag values are unchanged.
  • E2E tests are passing: not run.
  • Required E2E tests have been added (if applicable): not applicable.

Rename SPAN_FLAGS_CONTAINER_BACKGROUND to SPAN_FLAGS_EXCLUSIVE_EXCLUSIVE_PRIORITY
and use it for HeadingSpan instead of the inline flag combination added in #938.
@jnowakow
jnowakow marked this pull request as ready for review October 13, 2026 10:08
@jnowakow
jnowakow merged commit cf80b71 into main Oct 14, 2026
18 checks passed
@jnowakow
jnowakow deleted the refactor/android-span-priority-flag branch October 14, 2026 06: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