mirror of
https://github.com/zulip/zulip.git
synced 2025-11-14 19:06:09 +00:00
compose: Add spaces around markdown for attachments.
If your cursor is in the middle of a word when you upload an image, the code will now properly put spaces in the markdown around the attachment link. Fixes: #7212.
This commit is contained in:
@@ -114,10 +114,12 @@ exports.options = function (config) {
|
||||
|
||||
if (i === -1) {
|
||||
// This is a paste, so there's no filename. Show the image directly
|
||||
textarea.val(textarea.val() + "[pasted image](" + uri + ") ");
|
||||
var pasted_image_uri = "[pasted image](" + uri + ")";
|
||||
compose_ui.insert_syntax_and_focus(pasted_image_uri);
|
||||
} else {
|
||||
// This is a dropped file, so make the filename a link to the image
|
||||
textarea.val(textarea.val() + "[" + filename + "](" + uri + ")" + " ");
|
||||
var filename_uri = "[" + filename + "](" + uri + ")";
|
||||
compose_ui.insert_syntax_and_focus(filename_uri);
|
||||
}
|
||||
compose_ui.autosize_textarea();
|
||||
send_button.prop("disabled", false);
|
||||
|
||||
Reference in New Issue
Block a user