make extra network card description plaintext by default, with an option to re-enable HTML as it was

This commit is contained in:
AUTOMATIC1111
2024-02-22 21:27:10 +03:00
parent 052fbde3ac
commit 726aaea0fe
2 changed files with 6 additions and 1 deletions

View File

@@ -289,12 +289,16 @@ class ExtraNetworksPage:
}
)
description = (item.get("description", "") or "" if shared.opts.extra_networks_card_show_desc else "")
if not shared.opts.extra_networks_card_description_is_html:
description = html.escape(description)
# Some items here might not be used depending on HTML template used.
args = {
"background_image": background_image,
"card_clicked": onclick,
"copy_path_button": btn_copy_path,
"description": (item.get("description", "") or "" if shared.opts.extra_networks_card_show_desc else ""),
"description": description,
"edit_button": btn_edit_item,
"local_preview": quote_js(item["local_preview"]),
"metadata_button": btn_metadata,