summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/assets/javascripts/dropzone_input.js2
-rw-r--r--spec/features/issues_spec.rb9
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