Fix parsing of HTML in model descriptions.

This commit is contained in:
Sj-Si 2024-05-31 11:43:37 -04:00
parent a3e9b0ce04
commit 19f2c61f4c
7 changed files with 57 additions and 4 deletions

View file

@ -18,6 +18,7 @@
waitForBool,
copyToClipboard,
resizeGridSetup,
convertElementShadowDOM,
*/
/*eslint no-undef: "error"*/
@ -313,6 +314,11 @@ class ExtraNetworksTab {
(data) => {
if (data && data.html) {
this.card_list.updateHtml(elem, data.html);
// If this model's detail is displayed, update it.
const desc_elem = this.container_elem.querySelector(".model-info--name");
if (isElement(desc_elem) && desc_elem.textContent === elem.dataset.name) {
this.showDetsView(elem);
}
}
},
);
@ -927,7 +933,10 @@ class ExtraNetworksTab {
div_dets.innerHTML = "Error parsing model details.";
return;
}
div_dets.innerHTML = response.html;
convertElementShadowDOM(div_dets, "[data-parse-as-shadow-dom]");
};
_clear_details();