Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
a379e7bfafad
Commit
26768799
authored
Sep 10, 2015
by
Stan Hu
Browse files
Add comments and clean up test for !1274
parent
a5930ed943b0
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/gitlab/markdown/syntax_highlight_filter.rb
View file @
a379e7bf
...
...
@@ -24,6 +24,8 @@ def highlight_node(node)
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 @
a379e7bf
...
...
@@ -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