diff options
author | Adam Hegyi <ahegyi@gitlab.com> | 2019-06-19 08:48:19 +0300 |
---|---|---|
committer | Adam Hegyi <ahegyi@gitlab.com> | 2019-06-19 10:16:53 +0300 |
commit | 86c08225eb60a909701f9dfc6f767311cc2516c0 (patch) | |
tree | c5458097cb5e3354ada68bf5f36d263b9361316c /lib/gitlab/ci/ansi2html.rb | |
parent | 98a4a005d8d9eb4bf7e4b8fc601164055ced2199 (diff) |
Fix copying a single line from Firefox
This change ensures that all open <span> tags are closed before adding a
<br> tag.
Diffstat (limited to 'lib/gitlab/ci/ansi2html.rb')
-rw-r--r-- | lib/gitlab/ci/ansi2html.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/gitlab/ci/ansi2html.rb b/lib/gitlab/ci/ansi2html.rb index 6109b45ffd2..10d8c326c9a 100644 --- a/lib/gitlab/ci/ansi2html.rb +++ b/lib/gitlab/ci/ansi2html.rb @@ -200,7 +200,9 @@ module Gitlab css_classes = %w[section line] + sections.map { |section| "s_#{section}" } end - write_in_tag %{<br/>} + ensure_open_new_tag + write_raw %{<br/>} + close_open_tags write_raw %{<span class="#{css_classes.join(' ')}"></span>} if css_classes.any? @lineno_in_section += 1 open_new_tag |