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
end
def highlight(text, continue: true, plain: false)
lexer = @lexer
if plain
@formatter.format(Rouge::Lexers::PlainText.lex(text)).html_safe
else
@formatter.format(@lexer.lex(text, continue: continue)).html_safe
lexer = Rouge::Lexers::PlainText
continue = false
end
@formatter.format(@lexer.lex(text, continue: continue)).html_safe
rescue
@formatter.format(Rouge::Lexers::PlainText.lex(text)).html_safe
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