aboutsummaryrefslogtreecommitdiff
path: root/modules/ui_components.py
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2023-01-22 15:38:39 +0300
committerAUTOMATIC <16777216c@gmail.com>2023-01-22 15:38:39 +0300
commit68303c96e5ab31576a8238a24bf5b6191cf16ed1 (patch)
treeea342acc38fa77b71537d9004a9c83729ac92327 /modules/ui_components.py
parentc56b36712289020a98f0c77794b9045a251ecd55 (diff)
split oversize extras.py to postprocessing.py
Diffstat (limited to 'modules/ui_components.py')
-rw-r--r--modules/ui_components.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/ui_components.py b/modules/ui_components.py
index 46324425..989cc87b 100644
--- a/modules/ui_components.py
+++ b/modules/ui_components.py
@@ -1,3 +1,5 @@
+import html
+
import gradio as gr
@@ -47,3 +49,8 @@ class FormColorPicker(gr.ColorPicker, gr.components.FormComponent):
def get_block_name(self):
return "colorpicker"
+
+
+def plaintext_to_html(text):
+ text = "<p>" + "<br>\n".join([f"{html.escape(x)}" for x in text.split('\n')]) + "</p>"
+ return text