diff --git a/plugins/chat/app/models/chat/message.rb b/plugins/chat/app/models/chat/message.rb index 3cfaf92586d..c64d86307c4 100644 --- a/plugins/chat/app/models/chat/message.rb +++ b/plugins/chat/app/models/chat/message.rb @@ -214,7 +214,6 @@ module Chat chat-transcript discourse-local-dates emoji - emojiShortcuts inlineEmoji html-img hashtag-autocomplete @@ -253,6 +252,7 @@ module Chat features = MARKDOWN_FEATURES.dup features << "image-grid" if bot + features << "emojiShortcuts" if SiteSetting.enable_emoji_shortcuts rules = MARKDOWN_IT_RULES.dup rules << "heading" if bot diff --git a/plugins/chat/spec/models/chat/message_spec.rb b/plugins/chat/spec/models/chat/message_spec.rb index c3d5ab7dbd1..319e7c5972d 100644 --- a/plugins/chat/spec/models/chat/message_spec.rb +++ b/plugins/chat/spec/models/chat/message_spec.rb @@ -198,6 +198,34 @@ describe Chat::Message do end describe ".cook" do + context "with enable_emoji_shortcuts site setting" do + context "when enabled" do + before { SiteSetting.enable_emoji_shortcuts = true } + + it "converts emoji shortcuts to emoji" do + cooked = described_class.cook <<~MD + emoji shortcut :) + MD + + expected = + "
emoji shortcut 
emoji shortcut :)
") + end + end + end + it "does not support HTML tags" do cooked = described_class.cook("