瀏覽代碼

solves the lack of line breaks in chat download as pdf #8405

Luis Malhadas 3 月之前
父節點
當前提交
882d8f4ce1
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      backend/open_webui/utils/pdf_generator.py

+ 1 - 0
backend/open_webui/utils/pdf_generator.py

@@ -53,6 +53,7 @@ class PDFGenerator:
         # - https://facelessuser.github.io/pymdown-extensions/usage_notes/
         # - https://facelessuser.github.io/pymdown-extensions/usage_notes/
         # html_content = markdown(content, extensions=["pymdownx.extra"])
         # html_content = markdown(content, extensions=["pymdownx.extra"])
 
 
+        content = content.replace("\n", "<br/>")
         html_message = f"""
         html_message = f"""
             <div>
             <div>
                 <div>
                 <div>