Spaces:
Sleeping
Sleeping
Keldos
commited on
Commit
•
6c7c463
1
Parent(s):
ae0274b
fix: 修复因空格转译导致的在单词中换行错误
Browse files- modules/utils.py +2 -1
modules/utils.py
CHANGED
@@ -243,7 +243,7 @@ def escape_markdown(text):
|
|
243 |
Escape Markdown special characters to HTML-safe equivalents.
|
244 |
"""
|
245 |
escape_chars = {
|
246 |
-
' ': ' ',
|
247 |
'_': '_',
|
248 |
'*': '*',
|
249 |
'[': '[',
|
@@ -264,6 +264,7 @@ def escape_markdown(text):
|
|
264 |
'$': '$',
|
265 |
':': ':',
|
266 |
}
|
|
|
267 |
return ''.join(escape_chars.get(c, c) for c in text)
|
268 |
|
269 |
|
|
|
243 |
Escape Markdown special characters to HTML-safe equivalents.
|
244 |
"""
|
245 |
escape_chars = {
|
246 |
+
# ' ': ' ',
|
247 |
'_': '_',
|
248 |
'*': '*',
|
249 |
'[': '[',
|
|
|
264 |
'$': '$',
|
265 |
':': ':',
|
266 |
}
|
267 |
+
text = text.replace(' ', ' ')
|
268 |
return ''.join(escape_chars.get(c, c) for c in text)
|
269 |
|
270 |
|