FIX: only allows kbd and not details

This commit is contained in:
Joffrey JAFFEUX
2024-04-11 00:13:58 +02:00
committed by GitHub
parent 107015ff4b
commit d1cdac0e70
4 changed files with 14 additions and 139 deletions

View 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

View File

@ -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