diff options
author | AUTOMATIC <16777216c@gmail.com> | 2023-01-22 12:38:39 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2023-01-22 12:38:39 +0000 |
commit | 68303c96e5ab31576a8238a24bf5b6191cf16ed1 (patch) | |
tree | ea342acc38fa77b71537d9004a9c83729ac92327 /modules/ui_components.py | |
parent | c56b36712289020a98f0c77794b9045a251ecd55 (diff) | |
download | stable-diffusion-webui-gfx803-68303c96e5ab31576a8238a24bf5b6191cf16ed1.tar.gz stable-diffusion-webui-gfx803-68303c96e5ab31576a8238a24bf5b6191cf16ed1.tar.bz2 stable-diffusion-webui-gfx803-68303c96e5ab31576a8238a24bf5b6191cf16ed1.zip |
split oversize extras.py to postprocessing.py
Diffstat (limited to 'modules/ui_components.py')
-rw-r--r-- | modules/ui_components.py | 7 |
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
|