Skip to content

[codex] Fix centered HTML RTL compatibility#69

Closed
omers-oai wants to merge 2 commits intomainfrom
codex/fix-centered-html-rtl
Closed

[codex] Fix centered HTML RTL compatibility#69
omers-oai wants to merge 2 commits intomainfrom
codex/fix-centered-html-rtl

Conversation

@omers-oai
Copy link
Copy Markdown

Codex: Fix centered HTML rendering in RTL compatibility mode.

What changed

  • render AstHtmlBlock directly as block content instead of wrapping it in inline placeholder content
  • add Roborazzi preview repro coverage for centered neutral and Hebrew HTML with RTL compatibility both on and off

Why

  • the document-level intrinsic-width wrapper used by RTL compatibility interacted badly with inline HTML block placeholders
  • centered HTML then collapsed into a vertical stack instead of staying horizontally laid out

Impact

  • centered HTML remains readable and horizontal when enableRtlCompatibility = true
  • the existing RTL document-width behavior stays covered by the preview suite

Testing

  • ./gradlew :android-sample:testDebugUnitTest --console=plain
  • ./gradlew :android-sample:recordRoborazziDebug --console=plain
  • ./gradlew :richtext-markdown:allTests --console=plain
  • ./gradlew :android-sample:testDebugUnitTest :richtext-markdown:allTests --console=plain

@omers-oai omers-oai marked this pull request as ready for review April 6, 2026 18:59
appendInlineContent(content = InlineContent {
HtmlBlock(astNodeType.literal)
if (richTextRenderOptions.enableRtlCompatibility) {
HtmlBlock(astNodeType.literal)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason we don't just always do this?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unclear if this actually fixes something, but the goal here was to minimize the changes to an experiment so we if some weird case breaks it we have control to back it up.

I'm going to close this, since Codex wrongly thought another PR broke something, but it did not and this is not needed.

@omers-oai omers-oai closed this Apr 7, 2026
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.

2 participants