#16039·chatwoot

Canned responses lose ordered/bullet list markers on Telegram and API inboxes

Author: Timur2915Created Sep 28, 2026Updated Sep 29, 2026
Labels🍛 channel/api📨 channel/telegramBugCanned Response

Describe the bug

On Telegram (and API) inboxes, inserting a canned response that contains a numbered list silently removes the numbers. The list items stay behind as bare lines, so a numbered checklist sent to the customer loses its numbering. Nothing tells the agent that the content was changed.

Cause: FORMATTING['Channel::Telegram'].nodes is [] (same for Channel::Api) in app/javascript/dashboard/constants/editor.js. So on insertion, stripUnsupportedFormatting() in app/javascript/dashboard/helper/editorHelper.js applies the orderedList pattern from MARKDOWN_PATTERNS:

javascript
{ type: 'orderedList', patterns: [{ pattern: /^[\t ]*\d+[.)]\s+/gm, replacement: '' }] }

This deletes the 1. / 1) markers instead of keeping them as plain text. Bullet markers (- , * ) are removed the same way.

The backend does not need this. Messages::MarkdownRenderers::TelegramRenderer#list_item already renders ordered lists as 1. item and bullet lists as • item, so Telegram could receive the list as-is. The Telegram API itself has no list entity, but plain 1. text is fine.

A related symptom: after the markers are removed, the former list items become one paragraph joined by hard_break nodes. hard_break (from prosemirror-markdown's schema) has no leafText, so the composer's plain text (doc.textBetween(…, '\n\n'), which is what copying the draft produces) joins the lines with no separator:

Withdrawal number (#WD...)TXID of the withdrawalTXID of the refund transaction

The same happens to any ordinary single line break in a canned response. #13220 addressed the clipboard side of this but was closed unmerged.

To Reproduce

  1. Create a canned response:
    Please send us:
    
    1. Withdrawal number (#WD...)
    2. TXID of the withdrawal
    3. TXID of the refund transaction
  2. Open a conversation in a Telegram inbox (an API inbox behaves the same).
  3. Insert the canned response via /.
  4. The composer shows the three lines without 1., 2., 3., and the sent message has no numbering either.
  5. Copy the draft text from the composer: the three lines are joined into one.

Reproduced outside the browser against v4.18.0 sources (@chatwoot/prosemirror-schema 1.4.5): buildMessageSchema(FORMATTING['Channel::Telegram']) → stripUnsupportedFormatting → MessageMarkdownTransformer.parse gives paragraph("Withdrawal number (#WD...)", hard_break, "TXID of the withdrawal", hard_break, …).

Expected behavior

List markers are kept as literal text when the channel cannot render lists. Removing the formatting should not remove content. For Telegram in particular, the backend renderer already supports lists, so orderedList/bulletList could simply be allowed for Channel::Telegram.

Note: allowing lists for Telegram alone will still drop the first marker of a list that follows a blank line, which is the common canned-response layout, because of #15104.

Environment

Kubernetes

Cloud Provider

No response

Platform

Browser

Operating system

No response

Browser and version

No response

Docker (if applicable)

No response

Additional context

  • Chatwoot v4.18.0 (chatwoot/chatwoot:v4.18.0), self-hosted. The same stripping exists in v4.16.0 for 1.; v4.18.0 also strips 1) (#15362).
  • Stripping was introduced in #13028.
  • Related: #13731 / #13732 (plain-text mode for canned responses would also avoid this), #13220 (hard breaks lost on copy), #15104 (first list item after a blank line loses its marker in MarkdownRendererService).