diff --git a/plugins/chat/app/models/chat/message.rb b/plugins/chat/app/models/chat/message.rb index 7eac16609cf..776f2cfaa52 100644 --- a/plugins/chat/app/models/chat/message.rb +++ b/plugins/chat/app/models/chat/message.rb @@ -220,6 +220,7 @@ module Chat blockquote emphasis replacements + heading ] def self.cook(message, opts = {}) diff --git a/plugins/chat/spec/lib/chat/chat_pretty_text_spec.rb b/plugins/chat/spec/lib/chat/chat_pretty_text_spec.rb deleted file mode 100644 index 680ee0a5a04..00000000000 --- a/plugins/chat/spec/lib/chat/chat_pretty_text_spec.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -# -RSpec.describe Chat::Message do - describe ".cook" do - it "renders kbd inline tag" do - cooked = Chat::Message.cook <<~MD - Esc is pressed - MD - - expect(cooked).to include("
Esc is pressed
") - end - end -end diff --git a/plugins/chat/spec/models/chat/message_spec.rb b/plugins/chat/spec/models/chat/message_spec.rb index 2db7804c48a..06662497758 100644 --- a/plugins/chat/spec/models/chat/message_spec.rb +++ b/plugins/chat/spec/models/chat/message_spec.rb @@ -69,10 +69,34 @@ describe Chat::Message do ) end - it "does not support headings" do - cooked = described_class.cook("## heading 2") + it "supports kbd" do + cooked = described_class.cook <<~MD + Esc is pressed + MD - expect(cooked).to eq("## heading 2
") + expect(cooked).to match_html <<~HTML +Esc is pressed
+ HTML + end + + it "supports headings" do + cooked = described_class.cook <<~MD + # h1 + ## h2 + ### h3 + #### h4 + ##### h5 + ###### h6 + MD + + expect(cooked).to match_html <<~HTML +