discourse/plugins/chat/spec
Martin Brennan a51ce45508
FIX: Hashtag icon for style_type=icon not showing in rich editor (#35786)
When selecting a chat channel or a category with style_type=icon
from the hashtag autocomplete in the rich editor, the icon
was not being displayed correctly.

This was happening because when we reused the cache for hashtags
in a61009284e, it exposed an earlier
issue made in d06c60ca7c where we
override the `icon` property of the hashtag in the response
with the icon HTML.

Then, in the prosemirror hashtag extension, we would call
`hashtagTypeClass.generateIconHTML(validHashtag)`, which would
then do something like `iconHTML(hashtag.icon)`. But since
`hashtag.icon` was already the HTML, it would produce invalid HTML
similar to `<span class="d-icon-<span
class="d-icon-chat"></span>"></span>`.

This issue did not happen for style_type=emoji or style_type=square
because they had their own manual rendering methods.

The fix was to avoid overriding the `icon` property, instead storing
the icon HTML in a new property `iconHTML` in the hashtag object.
2025-11-05 16:52:38 +10:00
..
components/chat DEV: fix flakey spec (#34875) 2025-09-19 11:40:15 +02:00
fabricators FEATURE: disable chat DM threads by default (#34840) 2025-09-17 16:52:13 +04:00
integration DEV: add shortcut fab!(:variable, :fabricator) to specs (#33577) 2025-07-11 11:16:34 -03:00
jobs DEV: Update rubocop-discourse to 3.13 and autofix issues (#35073) 2025-10-06 16:11:01 +02:00
lib FIX: chat message bookmark title update (#35788) 2025-11-04 17:07:14 +04:00
mailers DEV: add shortcut fab!(:variable, :fabricator) to specs (#33577) 2025-07-11 11:16:34 -03:00
models FEATURE: Add full-text search for chat messages (#34704) 2025-10-22 11:30:35 +02:00
queries/chat DEV: add shortcut fab!(:variable, :fabricator) to specs (#33577) 2025-07-11 11:16:34 -03:00
requests PERF: Fix N+1 queries due to user custom fields when loading chat DMs (#35516) 2025-10-22 09:39:01 +08:00
serializer DEV: add shortcut fab!(:variable, :fabricator) to specs (#33577) 2025-07-11 11:16:34 -03:00
services FEATURE: Add full-text search for chat messages (#34704) 2025-10-22 11:30:35 +02:00
support DEV: add shortcut fab!(:variable, :fabricator) to specs (#33577) 2025-07-11 11:16:34 -03:00
system FIX: Hashtag icon for style_type=icon not showing in rich editor (#35786) 2025-11-05 16:52:38 +10:00
validators FEATURE: Add setting to prevent anonymous users from using chat (#31842) 2025-03-21 13:32:52 +03:00
plugin_helper.rb FIX: remove complicated 'chat_duplicate_message_sensitivity' site setting (#30516) 2025-01-13 12:32:51 +01:00
plugin_spec.rb DEV: add shortcut fab!(:variable, :fabricator) to specs (#33577) 2025-07-11 11:16:34 -03:00