Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
203d79c5
Commit
203d79c5
authored
Dec 07, 2020
by
Guillaume Grossetie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply style guideline
Follow-up gitlab-org/gitlab#47131
parent
5a0b7fee
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
14 deletions
+15
-14
spec/lib/banzai/filter/ascii_doc_sanitization_filter_spec.rb
spec/lib/banzai/filter/ascii_doc_sanitization_filter_spec.rb
+15
-14
No files found.
spec/lib/banzai/filter/ascii_doc_sanitization_filter_spec.rb
View file @
203d79c5
...
@@ -24,13 +24,13 @@ RSpec.describe Banzai::Filter::AsciiDocSanitizationFilter do
...
@@ -24,13 +24,13 @@ RSpec.describe Banzai::Filter::AsciiDocSanitizationFilter do
it
'preserves user-content- prefixed ids on div (blocks)'
do
it
'preserves user-content- prefixed ids on div (blocks)'
do
html_content
=
<<~
HTML
html_content
=
<<~
HTML
<div id="user-content-open-block" class="openblock">
<div id="user-content-open-block" class="openblock">
<div class="content">
<div class="content">
<div class="paragraph">
<div class="paragraph">
<p>This is an open block</p>
<p>This is an open block</p>
</div>
</div>
</div>
</div>
</div>
</div>
HTML
HTML
output
=
<<~
SANITIZED_HTML
output
=
<<~
SANITIZED_HTML
<div id="user-content-open-block">
<div id="user-content-open-block">
...
@@ -43,6 +43,7 @@ RSpec.describe Banzai::Filter::AsciiDocSanitizationFilter do
...
@@ -43,6 +43,7 @@ RSpec.describe Banzai::Filter::AsciiDocSanitizationFilter do
SANITIZED_HTML
SANITIZED_HTML
expect
(
filter
(
html_content
).
to_html
).
to
eq
(
output
)
expect
(
filter
(
html_content
).
to_html
).
to
eq
(
output
)
end
end
it
'preserves section anchor ids'
do
it
'preserves section anchor ids'
do
result
=
filter
(
%(<h2 id="user-content-first-section">
result
=
filter
(
%(<h2 id="user-content-first-section">
<a class="anchor" href="#user-content-first-section"></a>First section</h2>)
).
to_html
<a class="anchor" href="#user-content-first-section"></a>First section</h2>)
).
to_html
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment