Skip to content

Markdown: code blocks scroll horizontally instead of wrapping #270

Open

Description

@samitbasu

The Markdown widget (#254, PR #268) wraps a code block's long lines rather than scrolling them sideways, as GitHub and shadcn's typography do.

Why it wraps today: an eggshell horizontal scroll area needs a definite height, and a code block's height is its content's. Scrolling sideways needs a scroll axis that sizes to its content on the other axis (taffy overflow-x: auto with an auto height).

Wanted:

  • A code block whose lines exceed the column scrolls horizontally, keeps its own height, and keeps its fill and radius.
  • The same for the source shown in "Not shown: …" boxes.
  • A test through the real draw path: a long line in the sample, the block's height equal to one row per line, and a horizontal scroll reaching the line's end.

Related: #255 (highlighting), which will also want a non-wrapping code block; doing both together avoids reworking the block twice.

Activity

  1. added
    post-0.1
    on Nov 16, 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

    post-0.1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions