diff options
author | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-02-21 22:48:02 +0000 |
---|---|---|
committer | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-02-22 11:23:17 +0000 |
commit | 5fa9347136d6bfde7fe4433bfd7553f8802a23dd (patch) | |
tree | 10348086b698299532df5484702cf232c149135e | |
parent | 459a97d46812fecc59c973bad356935422c7f60e (diff) | |
download | gitlab-ce-newline-after-file-attachment-notes.tar.gz |
Added double newline after file upload markdown insertnewline-after-file-attachment-notes
-rw-r--r-- | app/assets/javascripts/dropzone_input.js | 2 | ||||
-rw-r--r-- | spec/features/issues_spec.rb | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/app/assets/javascripts/dropzone_input.js b/app/assets/javascripts/dropzone_input.js index 64a7a9eaf37..9099d747e0d 100644 --- a/app/assets/javascripts/dropzone_input.js +++ b/app/assets/javascripts/dropzone_input.js @@ -131,7 +131,7 @@ require('./preview_markdown'); textEnd = $(child).val().length; beforeSelection = $(child).val().substring(0, caretStart); afterSelection = $(child).val().substring(caretEnd, textEnd); - $(child).val(beforeSelection + text + afterSelection); + $(child).val(beforeSelection + text + afterSelection + "\n\n"); child.get(0).setSelectionRange(caretStart + text.length, caretEnd + text.length); return form_textarea.trigger("input"); }; diff --git a/spec/features/issues_spec.rb b/spec/features/issues_spec.rb index 094f645a077..ed3826bd46e 100644 --- a/spec/features/issues_spec.rb +++ b/spec/features/issues_spec.rb @@ -577,6 +577,15 @@ describe 'Issues', feature: true do expect(page.find_field("issue_description").value).to have_content 'banana_sample' end + + it 'adds double newline to end of attachment markdown' do + drop_in_dropzone test_image_file + + # Wait for the file to upload + sleep 1 + + expect(page.find_field("issue_description").value).to match /\n\n$/ + end end end |