mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
FIX: only allows kbd and not details
This commit is contained in:
14
plugins/chat/spec/lib/chat/chat_pretty_text_spec.rb
Normal file
14
plugins/chat/spec/lib/chat/chat_pretty_text_spec.rb
Normal file
@ -0,0 +1,14 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
#
|
||||
RSpec.describe Chat::Message do
|
||||
describe ".cook" do
|
||||
it "renders kbd inline tag" do
|
||||
cooked = Chat::Message.cook <<~MD
|
||||
<kbd>Esc</kbd> is pressed
|
||||
MD
|
||||
|
||||
expect(cooked).to include("<p><kbd>Esc</kbd> is pressed</p>")
|
||||
end
|
||||
end
|
||||
end
|
@ -97,28 +97,4 @@ RSpec.describe PrettyText do
|
||||
"<div class=\"chat-transcript-messages\">\n<p>original message</p></div>",
|
||||
)
|
||||
end
|
||||
|
||||
it "renders kbd inline tag" do
|
||||
cooked = PrettyText.cook <<~MD
|
||||
<kbd>Esc</kbd> is pressed
|
||||
MD
|
||||
|
||||
expect(cooked).to include("<p><kbd>Esc</kbd> is pressed</p>")
|
||||
end
|
||||
|
||||
it "renders details block tag" do
|
||||
cooked = PrettyText.cook <<~MD
|
||||
<details>
|
||||
<summary>Dog</summary>
|
||||
Cat
|
||||
</details>
|
||||
MD
|
||||
|
||||
expect(cooked).to include(<<~HTML.strip)
|
||||
<details>
|
||||
<summary>Dog</summary>
|
||||
Cat
|
||||
</details>
|
||||
HTML
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user