dlflannery commited on
Commit
c9c4133
·
verified ·
1 Parent(s): 6698aec

Update app.py

Browse files

Fixed ~ in markdown

Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -224,7 +224,8 @@ def extract_text_from_docx(file_path):
224
  return "\n".join(text)
225
 
226
  def md(txt):
227
- return str(txt).replace('```', ' ').replace(' ', '&nbsp;&nbsp;').replace(' ', '&nbsp;&nbsp;').replace(' ', '&nbsp;&nbsp;').replace('\n','<br>').replace('~~','\~')
 
228
 
229
  # def clean_history(db_path: str):
230
  # connection = sqlite3.connect(db_path)
@@ -355,6 +356,10 @@ async def chat(prompt_window, user_window, password, history, output_window,
355
  file_download = gr.DownloadButton(label='Download File', visible=False, value=None)
356
  image_window = gr.Image(visible=False, value=None)
357
 
 
 
 
 
358
  if not credentials_ok(user_window, password):
359
  return ['Invalid Credentials', prompt_window, uploaded_image_files,
360
  image_window, file_download, history, uploaded_file_paths, prior_inputs]
 
224
  return "\n".join(text)
225
 
226
  def md(txt):
227
+ # return str(txt).replace('```', ' ').replace(' ', '&nbsp;&nbsp;').replace(' ', '&nbsp;&nbsp;').replace(' ', '&nbsp;&nbsp;').replace('\n','<br>').replace('~~','\~').replace('~','\~')
228
+ return str(txt).replace('```', ' ').replace(' ', '&nbsp;&nbsp;').replace(' ', '&nbsp;&nbsp;').replace(' ', '&nbsp;&nbsp;').replace('\n','<br>').replace('~','\~')
229
 
230
  # def clean_history(db_path: str):
231
  # connection = sqlite3.connect(db_path)
 
356
  file_download = gr.DownloadButton(label='Download File', visible=False, value=None)
357
  image_window = gr.Image(visible=False, value=None)
358
 
359
+ # return [md('Hello, ~this is the text~ for you\nHello ~~This is text2~~ for you\n22.3 = ~22'),
360
+ # prompt_window, uploaded_image_files,
361
+ # image_window, file_download, history, uploaded_file_paths, prior_inputs]
362
+
363
  if not credentials_ok(user_window, password):
364
  return ['Invalid Credentials', prompt_window, uploaded_image_files,
365
  image_window, file_download, history, uploaded_file_paths, prior_inputs]