Skip to content

Android: code block box in a right-to-left list item ignores the paragraph direction #1072

Open

Description

@jnowakow

Context

Inside a list item, a code block's box starts at the item's text column: CodeBlockSpan reserves the item's indent as part of its leading margin and draws its background from left + leadingIndent.

For a right-to-left code paragraph, Android puts the leading margin on the right, but the background still removes the indent from the left. The box runs under the list marker on the right and leaves an empty gap on the left.

Reproduction

- עברית
  ```
  שורה ראשונה
  שורה שנייה
  ```
- הבא

The code lines need right-to-left text, because each paragraph's direction comes from its first strong character. Nesting the item, for example under a 1. item, widens the gap.

Expected

The box ends at the item's text column on the right and starts at the left edge, mirroring the left-to-right case.

Activity

  1. added
    bugSomething isn't working
    domain: codeCode blocks and inline code
    library: react-nativeTasks that are specifically for react-native-enriched-markdown
    library: androidtasks for android-enriched-markdown
    and removed
    library: androidtasks for android-enriched-markdown
    on Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdomain: codeCode blocks and inline codelibrary: react-nativeTasks that are specifically for react-native-enriched-markdownplatform: androidAffects the android platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions