Skip to content

[Bug]: Sent messages drop the spaces typed at the start of a line #38077

Closed

Description

@matthewcosier

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/web

Steps to reproduce

  1. Open any thread.
  2. In the composer, type Plan, press Shift+Enter, type three spaces and Step one, press Shift+Enter, then type eight spaces and Detail a.
  3. Send the message.

Expected behavior

The sent bubble shows the lines as they were typed:

Plan
   Step one
        Detail a

The agent receives exactly this text, so the composer, the bubble and the agent agree.

Actual behavior

The sent bubble shows every line flush left:

Plan
Step one
Detail a

Only the bubble is wrong: the agent receives the indentation intact. The bubble renders the message as Markdown with line breaks turned on. CommonMark folds the lines into one paragraph and strips each line's leading whitespace while parsing, so the indentation is gone before rendering. This is the same kind of gap as #33820 (written list numbers), #35859 (single tildes) and #4133 (literal tags) in sent messages.

Impact

Minor bug or occasional failure

Version or commit

main at 17c1425

Environment

Web and desktop. Any provider, since only the rendering of the sent message is affected. Reproduced on macOS in Chromium.

Logs or stack traces

No response

Screenshots, recordings, or supporting files

Sent message on main: every line flush left

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions