mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
implemented helper function to escape html symbols
This commit is contained in:
parent
bc1f3941fc
commit
5e31967310
1 changed files with 13 additions and 0 deletions
|
|
@ -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("<", "<")
|
||||
.replace(">", ">")
|
||||
.replace('"', """)
|
||||
.replace("'", "'")
|
||||
)
|
||||
|
||||
|
||||
def set_style_property(widget, property_name, property_value):
|
||||
"""Set widget's property that may affect style.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue