Skip to content

Commit b690b69

Browse files
authored
Merge pull request increments#155 from increments/allow-open-attribute-in-details
Allow open attribute on details
2 parents b9aacb6 + 89ef8c4 commit b690b69

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

lib/qiita/markdown/filters/final_sanitizer.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ class FinalSanitizer < ::HTML::Pipeline::Filter
6363
"th" => [
6464
"style",
6565
],
66+
"details" => [
67+
"open",
68+
],
6669
"video" => %w[
6770
src
6871
autoplay

lib/qiita/markdown/filters/user_input_sanitizer.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class UserInputSanitizer < ::HTML::Pipeline::Filter
1616
"blockquote" => %w[cite] + Embed::Tweet::ATTRIBUTES,
1717
"code" => %w[data-metadata],
1818
"div" => %w[class data-type data-metadata],
19+
"details" => %w[open],
1920
"font" => %w[color],
2021
"h1" => %w[id],
2122
"h2" => %w[id],

spec/qiita/markdown/processor_spec.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,6 +1067,11 @@
10671067
puts "Hello, World"
10681068
```
10691069
</div></details>
1070+
1071+
<details open close><summary>Folding sample2</summary>
1072+
1073+
it allows open attributes
1074+
</details>
10701075
MARKDOWN
10711076
end
10721077

@@ -1076,6 +1081,9 @@
10761081
<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>
10771082
</code></pre></div></div>
10781083
</div></details>
1084+
<details open><summary>Folding sample2</summary>
1085+
<p>it allows open attributes</p>
1086+
</details>
10791087
HTML
10801088
end
10811089
end

0 commit comments

Comments
 (0)