[Bug]: Composer leaves a line as plain text when a dash is added in front of it later#22997

opened21d agobyOOnkarj012

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. In the composer (rich text on), type -get md and press Shift+Enter.
  2. Move the caret back and type a space after the dash, so the line reads - get md.
  3. Click another line.

Expected behavior

The line shows as a bullet, the same as when you type - g in one go.

Actual behavior

The line stays plain text, but the composer saves and sends it as a Markdown list item (- get md). Anything that rebuilds the editor from the saved draft, such as attaching an image, then shows it as a bullet. The same happens when you type - in front of text that is already on the line.

The - input rule only fires while the marker is typed (-, space, first letter), so a dash or space added afterwards never becomes a list.

Impact

Minor bug or occasional failure

Version or commit

main at 680152e27b

Environment

macOS, desktop app (Nightly). Reproduced in a browser test against main.

Workaround

Delete the line and type - followed by the text in one go.

Reproduced on main at 70e5e384da, Linux web dev app, rich text enabled. Typed -get md, pressed Shift+Enter, moved after the dash, inserted a space, then clicked the empty second line: the editor kept <p>- get md</p>. Prepending - to existing get md also stayed a paragraph. Typing dash, space, then g produced a bullet. The exact sequence reproduced in both an empty conversation and a conversation with history.

Exact-sequence recording. Desktop was not checked.

Reproduction above matches the existing fix PR #22994. Linking it here so triage does not open a duplicate. The PR uses a different implementation from the isolated triage experiment; that experiment’s after captures do not verify the PR.