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
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
Show 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
def
whitelist
strong_memoize
(
:whitelist
)
do
customize_whitelist
(
super
.
dup
)
customize_whitelist
(
super
.
d
eep_d
up
)
end
end
...
...
spec/lib/banzai/filter/sanitization_filter_spec.rb
View file @
1771b194
...
...
@@ -54,6 +54,18 @@ describe Banzai::Filter::SanitizationFilter do
expect
(
instance
.
whitelist
[
:transformers
].
size
).
to
eq
control_count
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
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>}
...
...
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