From 89ef8c4b9b2e7291fe6089db5524799f8307554b Mon Sep 17 00:00:00 2001 From: nagaya Date: Thu, 28 Mar 2024 12:33:03 +0900 Subject: [PATCH] Allow open attribute on details --- lib/qiita/markdown/filters/final_sanitizer.rb | 3 +++ lib/qiita/markdown/filters/user_input_sanitizer.rb | 1 + spec/qiita/markdown/processor_spec.rb | 8 ++++++++ 3 files changed, 12 insertions(+) diff --git a/lib/qiita/markdown/filters/final_sanitizer.rb b/lib/qiita/markdown/filters/final_sanitizer.rb index 0f33252..878508f 100644 --- a/lib/qiita/markdown/filters/final_sanitizer.rb +++ b/lib/qiita/markdown/filters/final_sanitizer.rb @@ -63,6 +63,9 @@ class FinalSanitizer < ::HTML::Pipeline::Filter "th" => [ "style", ], + "details" => [ + "open", + ], "video" => %w[ src autoplay diff --git a/lib/qiita/markdown/filters/user_input_sanitizer.rb b/lib/qiita/markdown/filters/user_input_sanitizer.rb index de62447..ca94082 100644 --- a/lib/qiita/markdown/filters/user_input_sanitizer.rb +++ b/lib/qiita/markdown/filters/user_input_sanitizer.rb @@ -16,6 +16,7 @@ class UserInputSanitizer < ::HTML::Pipeline::Filter "blockquote" => %w[cite] + Embed::Tweet::ATTRIBUTES, "code" => %w[data-metadata], "div" => %w[class data-type data-metadata], + "details" => %w[open], "font" => %w[color], "h1" => %w[id], "h2" => %w[id], diff --git a/spec/qiita/markdown/processor_spec.rb b/spec/qiita/markdown/processor_spec.rb index 602fc2c..a7a7487 100644 --- a/spec/qiita/markdown/processor_spec.rb +++ b/spec/qiita/markdown/processor_spec.rb @@ -1067,6 +1067,11 @@ puts "Hello, World" ``` + +
Folding sample2 + + it allows open attributes +
MARKDOWN end @@ -1076,6 +1081,9 @@
puts "Hello, World"
             
+
Folding sample2 +

it allows open attributes

+
HTML end end