Skip to content

Commit

Permalink
Allow open attribute on details
Browse files Browse the repository at this point in the history
  • Loading branch information
atm-snag2 committed Mar 28, 2024
1 parent b9aacb6 commit 89ef8c4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/qiita/markdown/filters/final_sanitizer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ class FinalSanitizer < ::HTML::Pipeline::Filter
"th" => [
"style",
],
"details" => [
"open",
],
"video" => %w[
src
autoplay
Expand Down
1 change: 1 addition & 0 deletions lib/qiita/markdown/filters/user_input_sanitizer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
8 changes: 8 additions & 0 deletions spec/qiita/markdown/processor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1067,6 +1067,11 @@
puts "Hello, World"
```
</div></details>
<details open close><summary>Folding sample2</summary>
it allows open attributes
</details>
MARKDOWN
end

Expand All @@ -1076,6 +1081,9 @@
<div class="code-frame" data-lang="rb"><div class="highlight"><pre class="codehilite"><code><span class="nb">puts</span> <span class="s2">"Hello, World"</span>
</code></pre></div></div>
</div></details>
<details open><summary>Folding sample2</summary>
<p>it allows open attributes</p>
</details>
HTML
end
end
Expand Down

0 comments on commit 89ef8c4

Please sign in to comment.