Commit 6c624821 authored by Sean McGivern's avatar Sean McGivern

Merge branch '19086-double-newline' into 'master'

Fix Double Spaced CI Log

Closes #19086

See merge request !8349
parents 583deef2 76eec7ba
---
title: Fix double spaced CI log
merge_request: 8349
author: Jared Deckard <jared.deckard@gmail.com>
...@@ -105,7 +105,7 @@ module Ci ...@@ -105,7 +105,7 @@ module Ci
break break
elsif s.scan(/</) elsif s.scan(/</)
@out << '&lt;' @out << '&lt;'
elsif s.scan(/\n/) elsif s.scan(/\r?\n/)
@out << '<br>' @out << '<br>'
else else
@out << s.scan(/./m) @out << s.scan(/./m)
......
...@@ -136,6 +136,14 @@ describe Ci::Ansi2html, lib: true do ...@@ -136,6 +136,14 @@ describe Ci::Ansi2html, lib: true do
expect(subject.convert("<")[:html]).to eq('&lt;') expect(subject.convert("<")[:html]).to eq('&lt;')
end end
it "replaces newlines with line break tags" do
expect(subject.convert("\n")[:html]).to eq('<br>')
end
it "groups carriage returns with newlines" do
expect(subject.convert("\r\n")[:html]).to eq('<br>')
end
describe "incremental update" do describe "incremental update" do
shared_examples 'stateable converter' do shared_examples 'stateable converter' do
let(:pass1) { subject.convert(pre_text) } let(:pass1) { subject.convert(pre_text) }
......
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