nombed not return all elements
When we get an request with the proxy, the returned just the url in data, not the html and others elements in the preview of response.
Proposition:
`function (data) { // Build request URL var requestUrl = new URL(trumbowyg.o.plugins.noembed.proxy); Object.keys(data).forEach((key) => { requestUrl.searchParams.append(key, data[key].trim()); });
// Launch async request
fetch(requestUrl, {
method: 'GET',
cache: 'no-cache',
signal: AbortSignal.timeout(2000)
}).then((response) => {
return response.json().then((json) => {
if (trumbowyg.o.plugins.noembed.success) {
trumbowyg.o.plugins.noembed.success(json, trumbowyg, $modal);
return;
}
if (!json.html) {
trumbowyg.addErrorOnModalField(
$('input[type=text]', $modal),
json.error
);
return;
}
trumbowyg.execCmd('insertHTML', json.html);
setTimeout(function () {
trumbowyg.closeModal();
}, 250);
});
}).catch((...args) => {
if (trumbowyg.o.plugins.noembed.error) {
trumbowyg.o.plugins.noembed.error(...args);
return;
}
trumbowyg.addErrorOnModalField(
$('input[type=text]', $modal),
trumbowyg.lang.noembedError
);
});
}`
I reproduce, i tested my proxy which return truly html but I don't know why sucess callback return only a json like {video: "url-of-video"}
EDIT: i just found the problem the case only append when a plugins.noembed.sucessCallback is provided,
If you customize the success callback, you need to manage everything.
I hope it has worked since then!