diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-06-30 13:20:15 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-07-08 11:04:04 +0200 |
commit | c6f9a1c273beb7e427da1e384ed27e323d6f3b29 (patch) | |
tree | 9f2c94e7975c11870c2cca1bcfbe6d1dd169563a /lib/rouge | |
parent | 2c650b6f30d2e76cf632d6ce5771859aed67ac48 (diff) | |
download | gitlab-ce-c6f9a1c273beb7e427da1e384ed27e323d6f3b29.tar.gz |
Enable Style/IdenticalConditionalBranches Rubocop cop
Diffstat (limited to 'lib/rouge')
-rw-r--r-- | lib/rouge/formatters/html_gitlab.rb | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/lib/rouge/formatters/html_gitlab.rb b/lib/rouge/formatters/html_gitlab.rb index 8c309efc7b8..3358ed6773e 100644 --- a/lib/rouge/formatters/html_gitlab.rb +++ b/lib/rouge/formatters/html_gitlab.rb @@ -143,18 +143,14 @@ module Rouge '</span>' end end - lines.join("\n") - else - if @linenos == 'inline' - lines = lines.each_with_index.map do |line, index| - number = index + @linenostart - "<span class=\"linenos\">#{number}</span>#{line}" - end - lines.join("\n") - else - lines.join("\n") + elsif @linenos == 'inline' + lines = lines.each_with_index.map do |line, index| + number = index + @linenostart + "<span class=\"linenos\">#{number}</span>#{line}" end end + + lines.join("\n") end def span(tok, val) |