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
Tatuya Kamada
gitlab-ce
Commits
138e26b1
Commit
138e26b1
authored
Oct 04, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds v-pre to code blocks in comments
Closes #22911
parent
796f531f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
3 deletions
+17
-3
CHANGELOG
CHANGELOG
+2
-1
lib/banzai/filter/sanitization_filter.rb
lib/banzai/filter/sanitization_filter.rb
+1
-1
lib/banzai/filter/syntax_highlight_filter.rb
lib/banzai/filter/syntax_highlight_filter.rb
+2
-1
spec/features/notes_on_merge_requests_spec.rb
spec/features/notes_on_merge_requests_spec.rb
+12
-0
No files found.
CHANGELOG
View file @
138e26b1
...
...
@@ -14,6 +14,7 @@ v 8.13.0 (unreleased)
- Simplify Mentionable concern instance methods
- Fix permission for setting an issue's due date
- Expose expires_at field when sharing project on API
- Fix VueJS template tags being rendered in code comments
- Fix issue with page scrolling to top when closing or pinning sidebar (lukehowell)
- Allow the Koding integration to be configured through the API
- Added soft wrap button to repository file/blob editor
...
...
@@ -44,7 +45,7 @@ v 8.13.0 (unreleased)
- Notify the Merger about merge after successful build (Dimitris Karakasilis)
- Fix broken repository 500 errors in project list
- Close todos when accepting merge requests via the API !6486 (tonygambone)
- Changed Slack service user referencing from full name to username (Sebastian Poxhofer)
- Changed Slack service user referencing from full name to username (Sebastian Poxhofer)
- Add Container Registry on/off status to Admin Area !6638 (the-undefined)
v 8.12.4 (unreleased)
...
...
lib/banzai/filter/sanitization_filter.rb
View file @
138e26b1
...
...
@@ -25,7 +25,7 @@ module Banzai
return
if
customized?
(
whitelist
[
:transformers
])
# Allow code highlighting
whitelist
[
:attributes
][
'pre'
]
=
%w(class)
whitelist
[
:attributes
][
'pre'
]
=
%w(class
v-pre
)
whitelist
[
:attributes
][
'span'
]
=
%w(class)
# Allow table alignment
...
...
lib/banzai/filter/syntax_highlight_filter.rb
View file @
138e26b1
...
...
@@ -30,7 +30,8 @@ module Banzai
# users can still access an issue/comment/etc.
end
highlighted
=
%(<pre class="#{css_classes}"><code>#{code}</code></pre>)
highlighted
=
%(<pre class="#{css_classes}" v-pre="true"><code>#{code}</code></pre>)
puts
highlighted
# Extracted to a method to measure it
replace_parent_pre_element
(
node
,
highlighted
)
...
...
spec/features/notes_on_merge_requests_spec.rb
View file @
138e26b1
...
...
@@ -240,6 +240,18 @@ describe 'Comments', feature: true do
is_expected
.
to
have_css
(
'.notes_holder .note'
,
count:
1
)
is_expected
.
to
have_button
(
'Reply...'
)
end
it
'adds code to discussion'
do
click_button
'Reply...'
page
.
within
(
first
(
'.js-discussion-note-form'
))
do
fill_in
'note[note]'
,
with:
'```{{ test }}```'
click_button
(
'Comment'
)
end
expect
(
page
).
to
have_content
(
'{{ test }}'
)
end
end
end
end
...
...
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