Keldos commited on
Commit
3f820aa
·
1 Parent(s): 0de83a8

hotfix: 重做"fix: 使用<p>而非<pre>处理", fix #398

Browse files

This commit redo e19e89498bebb1be36a5aed868433247bbc4893f
解决 a3e85518bdfc230d113b5bfecb440a7956888170 不小心引入的错误。

Files changed (1) hide show
  1. modules/utils.py +1 -2
modules/utils.py CHANGED
@@ -115,8 +115,7 @@ def convert_mdtext(md_text):
115
 
116
 
117
  def convert_asis(userinput):
118
- escaped_html = html.escape(userinput).replace(" ", "&nbsp;").replace("\n", "<br>")
119
- return f"{escaped_html}"+ALREADY_CONVERTED_MARK
120
 
121
  def detect_converted_mark(userinput):
122
  if userinput.endswith(ALREADY_CONVERTED_MARK):
 
115
 
116
 
117
  def convert_asis(userinput):
118
+ return f"<p style=\"white-space:pre-wrap;\">{html.escape(userinput)}</p>"+ALREADY_CONVERTED_MARK
 
119
 
120
  def detect_converted_mark(userinput):
121
  if userinput.endswith(ALREADY_CONVERTED_MARK):