forked from rDrama/rDrama
1
0
Fork 0

nasty hack to stop underscores being interpreted as italic which breaks mentioning users with two underscores and links sometimes

master
Aevann 2023-06-30 22:47:30 +03:00
parent 0762f179b7
commit daedb5f047
1 changed files with 2 additions and 0 deletions

View File

@ -367,7 +367,9 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=False, count_emojis
sanitized = strikethrough_regex.sub(r'\1<del>\2</del>', sanitized)
sanitized = sanitized.replace('_', '')
sanitized = markdown(sanitized)
sanitized = sanitized.replace('', '_')
# replacing zero width characters, overlines, fake colons
sanitized = sanitized.replace('\u200e','').replace('\u200b','').replace("\ufeff", "").replace("\u033f","").replace("\u0589", ":")