mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
error dialog: Detect HTML markup in details
This commit is contained in:
parent
58488d0e54
commit
9564a65000
@ -134,6 +134,11 @@ def create_simple_dialog(title, msg, details, icon_name, prefix):
|
|||||||
html_container = E.div()
|
html_container = E.div()
|
||||||
if is_html_msg:
|
if is_html_msg:
|
||||||
html_container.innerHTML = 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(
|
parent.appendChild(
|
||||||
E.div(
|
E.div(
|
||||||
style='max-width:60em; text-align: left',
|
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((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'),
|
E.div(style='display: ' + ('block' if details else 'none'),
|
||||||
show_details,
|
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'
|
style='display:none; white-space:pre-wrap; font-size: smaller; margin-top: 1em; border-top: solid 1px currentColor; padding-top: 1em'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user