split oversize extras.py to postprocessing.py

This commit is contained in:
AUTOMATIC
2023-01-22 15:38:39 +03:00
parent c56b367122
commit 68303c96e5
5 changed files with 18 additions and 474 deletions

View File

@@ -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