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
26768799
Commit
26768799
authored
Sep 10, 2015
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add comments and clean up test for !1274
parent
b2f3d024
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
3 deletions
+2
-3
lib/gitlab/markdown/syntax_highlight_filter.rb
lib/gitlab/markdown/syntax_highlight_filter.rb
+2
-0
spec/lib/gitlab/markdown/syntax_highlight_filter_spec.rb
spec/lib/gitlab/markdown/syntax_highlight_filter_spec.rb
+0
-3
No files found.
lib/gitlab/markdown/syntax_highlight_filter.rb
View file @
26768799
...
...
@@ -24,6 +24,8 @@ module Gitlab
begin
highlighted
=
block_code
(
code
,
language
)
rescue
# Gracefully handle syntax highlighter bugs/errors to ensure
# users can still access an issue/comment/etc.
highlighted
=
"<pre>
#{
code
}
</pre>"
end
...
...
spec/lib/gitlab/markdown/syntax_highlight_filter_spec.rb
View file @
26768799
...
...
@@ -4,9 +4,6 @@ module Gitlab::Markdown
describe
SyntaxHighlightFilter
do
include
FilterSpecHelper
let
(
:project
)
{
create
(
:empty_project
)
}
let
(
:reference
)
{
snippet
.
to_reference
}
it
'highlights valid code blocks'
do
result
=
filter
(
'<pre><code>def fun end</code>'
)
expect
(
result
.
to_html
).
to
eq
(
"<pre class=
\"
code highlight js-syntax-highlight plaintext
\"
><code>def fun end</code></pre>
\n
"
)
...
...
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