tinymce обрезает url адрес в
после загрузки изрображения
<script>
const example_image_upload_handler = (blobInfo, progress) => new Promise((resolve, reject) => {
const xhr = new XMLHttpRequest();
xhr.withCredentials = false;
xhr.open('POST', 'postAcceptor.php');
xhr.upload.onprogress = (e) => {
progress(e.loaded / e.total * 100);
};
xhr.onload = () => {
if (xhr.status < 200 || xhr.status >= 300) {
reject('HTTP Error: ' + xhr.status);
return;
}
const json = JSON.parse(xhr.responseText);
if (!json || typeof json.location != 'string') {
reject('Invalid JSON: ' + xhr.responseText);
return;
}
resolve(json.location);
};
xhr.onerror = () => {
reject('Image upload failed due to a XHR Transport error. Code: ' + xhr.status);
};
const formData = new FormData();
formData.append('file', blobInfo.blob(), blobInfo.filename());
xhr.send(formData);
});
tinymce.init({
selector: '#text',
plugins: ['media', 'autoresize', 'charmap', 'code', 'emoticons', 'insertdatetime', 'link', 'lists', 'media', 'quickbars', 'table', 'save'],
toolbar: ['link numlist bullist media quickimage table alignleft aligncenter alignright alignjustify backcolor bold italic underline fontsize forecolor backcolor charmap code emoticons insertdatetime', ' undo redo subscript superscript save'],
quickbars_selection_toolbar: 'bold italic | blocks | quicklink blockquote h2 h3 ',
media_url_resolver: function(data, resolve /*, reject*/ ) {
if (data.url.indexOf('YOUR_SPECIAL_VIDEO_URL') !== -1) {
const embedHtml = `<iframe src="${data.url}" width="400" height="400" ></iframe>`;
resolve({
html: embedHtml
});
}
},
language: 'ru',
//images_upload_url: 'postAcceptor.php',
convert_urls: false,
images_upload_handler: example_image_upload_handler,
});
сейчас в src вставляется -http://agusait/panel/images/mceu_8489898321670791044128.jpg
если убрать convert_urls: false то будет выводить images/mceu_8489898321670791044128.jpg
хотелось бы чтобы выводило так- /panel/images/mceu_8489898321670791044128.jpg