var items = (event.clipboardData || event.originalEvent.clipboardData).items;
        for (var index in items) {
            var item = items[index];
            if (item.kind === 'file') {
                var blob = item.getAsFile();
                var formData = new FormData();
                formData.append('file', blob);

                var xhr = new XMLHttpRequest();
                xhr.open('POST', '/pic/upload', true);
                xhr.onload = function () {
                    if (xhr.status === 200) {
                        var response = JSON.parse(xhr.responseText);
                        var markdown_url = "![" + response.title + "](" + response.pic + ")";
                        newText = oldText.substring(0, selectionStart) + markdown_url + oldText.substring(selectionStart);
                        editor.val(newText);
                        editor.trigger('keyup');
                    }
                }
                xhr.send(formData);
            }
        }