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

Fix Double Spaced CI Log

Closes #19086

See merge request !8349
This commit is contained in:
Sean McGivern 2017-01-09 15:50:05 +00:00
commit 6c62482144
3 changed files with 13 additions and 1 deletions

View file

@ -0,0 +1,4 @@
---
title: Fix double spaced CI log
merge_request: 8349
author: Jared Deckard <jared.deckard@gmail.com>

View file

@ -105,7 +105,7 @@ module Ci
break
elsif s.scan(/</)
@out << '&lt;'
elsif s.scan(/\n/)
elsif s.scan(/\r?\n/)
@out << '<br>'
else
@out << s.scan(/./m)

View file

@ -136,6 +136,14 @@ describe Ci::Ansi2html, lib: true do
expect(subject.convert("<")[:html]).to eq('&lt;')
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
shared_examples 'stateable converter' do
let(:pass1) { subject.convert(pre_text) }