Skip to content

[Bug]: Caret lands before closing Markdown markers after pasting into the composer #41321

Closed

Description

@faga295

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 a thread in the Web client with Rich text composer enabled.
  2. Paste the literal Markdown text **DEV** into an empty composer.
  3. Immediately type ! without moving the caret.

Expected behavior

The caret lands after the closing **. Typing ! produces **DEV**!, with the exclamation mark outside the bold text.

Actual behavior

The caret lands between DEV and the closing **. Typing ! produces **DEV!**.

This also affects italic, strikethrough, inline code, and nested styles.

Pasted text Actual after typing ! Expected
__DEV__ **DEV!** **DEV**!
*DEV* or _DEV_ *DEV!* *DEV*!
~~DEV~~ ~~DEV!~~ ~~DEV~~!
`DEV` `DEV!` `DEV`!
***DEV*** ***DEV!*** ***DEV***!

Both attached screenshots show the result of pasting **DEV** and typing !. The before-fix image shows the repro. The after-fix image shows the expected behavior with a local fix.

Impact

Minor bug or occasional failure

Version or commit

ad621cc (source checkout)

Environment

Web client, macOS 15.8.2, Chromium 156.0.8078.4, Node.js 26.13.1

Logs or stack traces

Screenshots, recordings, or supporting files

image image

Workaround

Move the caret past the closing delimiter before typing more text.

Activity

  1. added
    bug
    needs-triage
    on Nov 23, 2026
  2. juliusmarminge commented on Nov 23, 2026

    @juliusmarminge
    Member

    A fix for this was proposed in #41333, but when the reported steps were run in the real app the problem did not appear.

    What was run on 3389253104, the commit before this change:

    Open the seeded thread with Rich text composer enabled. Clear the composer, paste plain-text Markdown using the native clipboard, then immediately type ! without moving the caret. Repeat for DEV, DEV, DEV, DEV, and DEV. On both commits, DEV retained its style and ! remained outside every style. The completed comparison was repeated with the same outcome.

    How: Scenario runner drove the real web client in Chromium at 1280×800, light theme, with separate fresh databases and synthetic project/thread data created through t3.project and t3.thread. Reviewed captures and recording frames from both commits.

    Could you share the exact steps, what you see, and the version and platform you are on? The pull request is closed for now; the fix is picked up again once the problem can be shown.

  3. added
    needs more info
    on Nov 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

    bugneeds more infoneeds-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions