implemented helper function to escape html symbols

This commit is contained in:
Jakub Trllo 2022-07-25 10:53:07 +02:00
parent bc1f3941fc
commit 5e31967310

View file

@ -37,6 +37,19 @@ def center_window(window):
window.move(geo.topLeft())
def html_escape(text):
"""Basic escape of html syntax symbols in text."""
return (
text
.replace("&", "&")
.replace("<", "&lt;")
.replace(">", "&gt;")
.replace('"', "&quot;")
.replace("'", "&#x27;")
)
def set_style_property(widget, property_name, property_value):
"""Set widget's property that may affect style.