chatwoot/app/javascript/shared/helpers
Sivin Varghese b429ce0ad5
fix: Prevent template variables from becoming links (#10725)
# Pull Request Template

## Description

**Issue**
This PR fixes template variables in messages (e.g., {{customer.name}})
that were being incorrectly converted to clickable links by the
`MessageFormatter's linkify` functionality. This caused formatting
issues and broken links.

**Solution**
Added a `linkify` parameter to `MessageFormatter` to optionally disable
link conversion

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

## How Has This Been Tested?

**Screenshots**

**Before**
<img width="1012" alt="image"
src="https://github.com/user-attachments/assets/70abb238-b4d9-439d-9e51-c7513cf482fb"
/>


**After**
<img width="1012" alt="image"
src="https://github.com/user-attachments/assets/387acb74-674e-4b26-85cc-2d7190d256b1"
/>




## 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
2025-01-23 18:18:14 +05:30
..
markdownIt chore: Use markdown-it instead of marked (#6123) 2023-03-03 13:26:54 +05:30
specs fix: Prevent template variables from becoming links (#10725) 2025-01-23 18:18:14 +05:30
vuex feat: Vite + vue 3 💚 (#10047) 2024-10-02 00:36:30 -07:00
AudioNotificationHelper.js feat: update tool-chain to latest (#7975) 2023-09-27 14:02:34 +05:30
BaseActionCableConnector.js feat: Reconnect logic (#9453) 2024-06-03 15:54:19 +05:30
clipboard.js chore: Replace packages with native functions (#5140) 2022-08-03 17:08:21 +05:30
colorHelper.js feat: Update public portal colors with new design (#8230) 2023-11-23 08:16:52 +05:30
CustomErrors.js Feat: Create contact from contacts page (#1806) 2021-02-19 20:22:58 +05:30
CustomEventHelper.js feat: Add chatwoot:error sdk event (#3998) 2022-02-21 09:40:11 +05:30
DateHelper.js fix: Retry message not working if the conversation has an external issue (#8529) 2023-12-13 15:46:10 +05:30
emoji.js chore: Check for empty strings in name formatter (#5434) 2022-09-14 07:15:04 -07:00
FileHelper.js feat: update tool-chain to latest (#7975) 2023-09-27 14:02:34 +05:30
HTMLSanitizer.js fix: Render links with target attribute (#4685) 2022-05-16 11:29:05 +05:30
IntegrationHelper.js feat: Add the support for video calls with Dyte in the live-chat widget (#6208) 2023-01-09 11:52:31 -08:00
KeyboardHelpers.js feat: Rewrite keyboardEventListener mixin to a composable (#9831) 2024-08-05 18:59:47 +05:30
localStorage.js feat: Implement reply to for reply editor (#8063) 2023-10-10 19:13:12 +05:30
MessageFormatter.js fix: Prevent template variables from becoming links (#10725) 2025-01-23 18:18:14 +05:30
MessageTypeHelper.js chore: Bump up character limit for email channel (#10082) 2024-09-07 08:41:18 +05:30
mitt.js chore: Replace eventBus with mitt.js [CW-3275] (#9539) 2024-05-31 15:50:36 +05:30
ReportsDataHelper.js feat: add Conversation traffic heatmap (#6508) 2023-03-07 09:01:58 +05:30
sanitizeData.js feat: multiple UX improvements to labels (#7358) 2023-06-25 18:49:49 +05:30
timeHelper.js feat: Move timeMixin to a helper (#9799) 2024-07-22 13:07:29 +05:30
Validators.js feat: Rewrite customAttributeMixin to validation helper (#9916) 2024-08-09 18:37:26 +05:30