diff --git a/src/pyj/modals.pyj b/src/pyj/modals.pyj index 8fb343a839..d53f4fde7f 100644 --- a/src/pyj/modals.pyj +++ b/src/pyj/modals.pyj @@ -134,6 +134,11 @@ def create_simple_dialog(title, msg, details, icon_name, prefix): html_container = E.div() if is_html_msg: html_container.innerHTML = msg + details_container = E.span() + if /<[a-zA-Z]/.test(details): + details_container.innerHTML = details + else: + details_container.textContent = details parent.appendChild( E.div( style='max-width:60em; text-align: left', @@ -144,7 +149,7 @@ def create_simple_dialog(title, msg, details, icon_name, prefix): E.div((html_container if is_html_msg else msg), style='padding-top: 1em; margin-top: 1em; border-top: 1px solid currentColor'), E.div(style='display: ' + ('block' if details else 'none'), show_details, - E.div(details, + E.div(details_container, style='display:none; white-space:pre-wrap; font-size: smaller; margin-top: 1em; border-top: solid 1px currentColor; padding-top: 1em' ) )