summaryrefslogtreecommitdiff
path: root/lib/gitlab/ci/ansi2html.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/ci/ansi2html.rb')
-rw-r--r--lib/gitlab/ci/ansi2html.rb17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/gitlab/ci/ansi2html.rb b/lib/gitlab/ci/ansi2html.rb
index 8335e1c1a7a..7e348763e81 100644
--- a/lib/gitlab/ci/ansi2html.rb
+++ b/lib/gitlab/ci/ansi2html.rb
@@ -196,13 +196,8 @@ module Gitlab
def handle_new_line
write_in_tag %{<br/>}
- if @sections.any?
- css_classes = %w[section line] + sections.map { |section| "s_#{section}" }
- write_raw %{<span class="#{css_classes.join(' ')}"></span>}
- end
-
+ close_open_tags if @sections.any? && @lineno_in_section == 0
@lineno_in_section += 1
- ensure_open_new_tag
end
def handle_section(scanner)
@@ -309,10 +304,18 @@ module Gitlab
if @sections.any?
css_classes << "section"
- css_classes << "js-section-header section-header" if @lineno_in_section == 0
+
+ css_classes << if @lineno_in_section == 0
+ "js-section-header section-header"
+ else
+ "line"
+ end
+
css_classes += sections.map { |section| "js-s-#{section}" }
end
+ close_open_tags
+
@out << if css_classes.any?
%{<span class="#{css_classes.join(' ')}">}
else