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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
1771b194
Commit
1771b194
authored
Jul 24, 2018
by
Stan Hu
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master' into dev-master
parents
236ed1f2
d1148002
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
1 deletion
+18
-1
changelogs/unreleased/sh-revert-markdown-changes.yml
changelogs/unreleased/sh-revert-markdown-changes.yml
+5
-0
lib/banzai/filter/sanitization_filter.rb
lib/banzai/filter/sanitization_filter.rb
+1
-1
spec/lib/banzai/filter/sanitization_filter_spec.rb
spec/lib/banzai/filter/sanitization_filter_spec.rb
+12
-0
No files found.
changelogs/unreleased/sh-revert-markdown-changes.yml
0 → 100644
View file @
1771b194
---
title
:
Fix slow Markdown rendering
merge_request
:
20820
author
:
type
:
performance
lib/banzai/filter/sanitization_filter.rb
View file @
1771b194
...
@@ -13,7 +13,7 @@ module Banzai
...
@@ -13,7 +13,7 @@ module Banzai
def
whitelist
def
whitelist
strong_memoize
(
:whitelist
)
do
strong_memoize
(
:whitelist
)
do
customize_whitelist
(
super
.
dup
)
customize_whitelist
(
super
.
d
eep_d
up
)
end
end
end
end
...
...
spec/lib/banzai/filter/sanitization_filter_spec.rb
View file @
1771b194
...
@@ -54,6 +54,18 @@ describe Banzai::Filter::SanitizationFilter do
...
@@ -54,6 +54,18 @@ describe Banzai::Filter::SanitizationFilter do
expect
(
instance
.
whitelist
[
:transformers
].
size
).
to
eq
control_count
expect
(
instance
.
whitelist
[
:transformers
].
size
).
to
eq
control_count
end
end
it
'customizes the whitelist only once for different instances'
do
instance1
=
described_class
.
new
(
'Foo1'
)
instance2
=
described_class
.
new
(
'Foo2'
)
control_count
=
instance1
.
whitelist
[
:transformers
].
size
instance1
.
whitelist
instance2
.
whitelist
expect
(
instance1
.
whitelist
[
:transformers
].
size
).
to
eq
control_count
expect
(
instance2
.
whitelist
[
:transformers
].
size
).
to
eq
control_count
end
it
'sanitizes `class` attribute from all elements'
do
it
'sanitizes `class` attribute from all elements'
do
act
=
%q{<pre class="code highlight white c"><code><span class="k">def</span></code></pre>}
act
=
%q{<pre class="code highlight white c"><code><span class="k">def</span></code></pre>}
exp
=
%q{<pre><code><span class="k">def</span></code></pre>}
exp
=
%q{<pre><code><span class="k">def</span></code></pre>}
...
...
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