iachat/app/javascript/dashboard/helper
Sivin Varghese df4c8cf58b
chore: Strip unsupported signature formatting by channel (#13046)
# Pull Request Template

## Description

1. This PR is an enhancement to
https://github.com/chatwoot/chatwoot/pull/13045
It strips unsupported formatting from **message signatures** based on
each channel’s formatting capabilities defined in the `FORMATTING`
config

2. Remove usage of plain editor in Compose new conversation modal

Only the following signature elements are considered:
<strong>bold (<code inline="">strong</code>), italic (<code
inline="">em</code>), links (<code inline="">link</code>), images (<code
inline="">image</code>)</strong>.</p>

Any formatting not supported by the target channel is automatically
removed before the signature is appended.

<h3>Channel-wise Signature Formatting Support</h3>

Channel | Keeps in Signature | Strips from Signature
-- | -- | --
Email | bold, italic, links, images | —
WebWidget | bold, italic, links, images | —
API | bold, italic | links, images
WhatsApp | bold, italic | links, images
Telegram | bold, italic, links | images
Facebook | bold, italic | links, images
Instagram | bold, italic | links, images
Line | bold, italic | links, images
SMS | — | everything
Twilio SMS | — | everything
Twitter/X | — | everything


<hr>
<h3>📝 Note</h3>
<blockquote>
<p>Message signatures only support <strong>bold, italic, links, and
images</strong>.<br>
Other formatting options available in the editor (lists, code blocks,
strike-through, etc.) do <strong>not apply</strong> to signatures and
are ignored.</p>
</blockquote>

## Type of change

- [x] New feature (non-breaking change which adds functionality)

## How Has This Been Tested?

### Loom video
https://www.loom.com/share/d325ab86ca514c6d8f90dfe72a8928dd


## Checklist:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my code
- [x] I have commented on my code, particularly in hard-to-understand
areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream
modules

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2025-12-11 19:58:59 +05:30
..
AnalyticsHelper feat: Setup posthog analytics (#12291) 2025-08-27 09:10:06 +05:30
AudioAlerts
CacheHelper
commandbar
specs chore: Strip unsupported signature formatting by channel (#13046) 2025-12-11 19:58:59 +05:30
actionCable.js feat: Add stores for copilotMessages and copilotThreads (#11603) 2025-05-27 18:36:32 -06:00
actionQueryGenerator.js
agentHelper.js
APIHelper.js
auditlogHelper.js feat: Add conversation delete feature (#11677) 2025-06-05 15:53:17 -05:00
automationHelper.js feat: Add support for labels in automations (#11658) 2025-09-18 14:17:54 +05:30
commons.js feat: Agent assignment policy index page with CRUD actions (#12373) 2025-09-10 12:07:21 +05:30
conversationHelper.js
customViewsHelper.js
DOMHelpers.js
downloadHelper.js
editorHelper.js chore: Strip unsupported signature formatting by channel (#13046) 2025-12-11 19:58:59 +05:30
emailQuoteExtractor.js feat: allow quoted email thread in reply (#12545) 2025-09-30 17:47:09 +05:30
featureHelper.js feat: SAML UI [CW-2958] (#12345) 2025-09-15 19:33:54 +05:30
filterQueryGenerator.js
flag.js
inbox.js chore: Strip unsupported signature formatting by channel (#13046) 2025-12-11 19:58:59 +05:30
labelColor.js
permissionsHelper.js chore: Remove older UI (#11720) 2025-07-01 09:43:44 +05:30
portalHelper.js chore: Remove older UI (#11720) 2025-07-01 09:43:44 +05:30
preChat.js
pushHelper.js feat: Log push notification error (#12543) 2025-09-29 15:19:45 +05:30
quotedEmailHelper.js feat: allow quoted email thread in reply (#12545) 2025-09-30 17:47:09 +05:30
ReconnectService.js
routeHelpers.js
scriptHelpers.js chore(docs): Fix typos in some files (#12817) 2025-11-07 07:57:37 -08:00
snoozeHelpers.js
states.js
templateHelper.js feat: Add media_name support for WhatsApp templates document files (#12462) 2025-09-18 15:25:31 +05:30
themeHelper.js
uploadHelper.js
URLHelper.js feat: Add UI to manage web widget allowed domains (#12495) 2025-09-24 16:46:19 +05:30
validations.js chore: Add open conversation option (#11828) 2025-07-02 10:01:50 +05:30