summaryrefslogtreecommitdiff
path: root/lib/rouge
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-06-30 13:20:15 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-07-08 11:04:04 +0200
commitc6f9a1c273beb7e427da1e384ed27e323d6f3b29 (patch)
tree9f2c94e7975c11870c2cca1bcfbe6d1dd169563a /lib/rouge
parent2c650b6f30d2e76cf632d6ce5771859aed67ac48 (diff)
downloadgitlab-ce-c6f9a1c273beb7e427da1e384ed27e323d6f3b29.tar.gz
Enable Style/IdenticalConditionalBranches Rubocop cop
Diffstat (limited to 'lib/rouge')
-rw-r--r--lib/rouge/formatters/html_gitlab.rb16
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)