Tuchuanhuhuhu commited on
Commit
dd405b6
·
1 Parent(s): 54e7067

修复符号*显示

Browse files
Files changed (1) hide show
  1. ChuanhuChatbot.py +8 -0
ChuanhuChatbot.py CHANGED
@@ -61,6 +61,14 @@ def parse_text(text):
61
  line = line.replace("<", "&lt;")
62
  line = line.replace(">", "&gt;")
63
  line = line.replace(" ", "&nbsp;")
 
 
 
 
 
 
 
 
64
  lines[i] = "<br>"+line
65
  text = "".join(lines)
66
  return text
 
61
  line = line.replace("<", "&lt;")
62
  line = line.replace(">", "&gt;")
63
  line = line.replace(" ", "&nbsp;")
64
+ line = line.replace("*", "&ast;")
65
+ line = line.replace("_", "&lowbar;")
66
+ line = line.replace("{", "&#123;")
67
+ line = line.replace("}", "&#125;")
68
+ line = line.replace("[", "&#91;")
69
+ line = line.replace("]", "&#93;")
70
+ line = line.replace("|", "&#124;")
71
+ line = line.replace("-", "&#45;")
72
  lines[i] = "<br>"+line
73
  text = "".join(lines)
74
  return text