Correctly indent quotes in new issue description

By using `>`-quote style instead of `>>>`.

Also: Update documentation images.
This commit is contained in:
Bob Van Landuyt 2017-03-08 00:55:50 +01:00
parent 52c0195dcc
commit 5eee47758c
4 changed files with 6 additions and 5 deletions

View File

@ -43,7 +43,8 @@ module Issues
discussion_info << " (+#{other_note_count} #{'comment'.pluralize(other_note_count)})" if other_note_count > 0
note_without_block_quotes = Banzai::Filter::BlockquoteFenceFilter.new(first_note.note).call
quote = ">>>\n#{note_without_block_quotes}\n>>>"
spaces = ' ' * 4
quote = note_without_block_quotes.lines.map { |line| "#{spaces}> #{line}" }.join
[discussion_info, quote].join("\n\n")
end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 172 KiB

After

Width:  |  Height:  |  Size: 210 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 KiB

After

Width:  |  Height:  |  Size: 140 KiB

View File

@ -57,11 +57,11 @@ describe Issues::BuildService, services: true do
"with a blockquote\n"\
"> That has a quote\n"\
">>>\n"
note_result = "This is a string\n"\
"> with a blockquote\n"\
"> > That has a quote\n"
note_result = " > This is a string\n"\
" > > with a blockquote\n"\
" > > > That has a quote\n"
discussion = Discussion.new([create(:diff_note_on_merge_request, note: note_text)])
expect(service.item_for_discussion(discussion)).to include(">>>\n#{note_result}\n>>>")
expect(service.item_for_discussion(discussion)).to include(note_result)
end
end