Commit 681b5af5 authored by http://jneen.net/'s avatar http://jneen.net/

do this thing in a clearer way

parent 95d6174a
...@@ -28,11 +28,14 @@ module Gitlab ...@@ -28,11 +28,14 @@ module Gitlab
end end
def highlight(text, continue: true, plain: false) def highlight(text, continue: true, plain: false)
lexer = @lexer
if plain if plain
@formatter.format(Rouge::Lexers::PlainText.lex(text)).html_safe lexer = Rouge::Lexers::PlainText
else continue = false
@formatter.format(@lexer.lex(text, continue: continue)).html_safe
end end
@formatter.format(@lexer.lex(text, continue: continue)).html_safe
rescue rescue
@formatter.format(Rouge::Lexers::PlainText.lex(text)).html_safe @formatter.format(Rouge::Lexers::PlainText.lex(text)).html_safe
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment