sanitize hashtags

master
bakatrouble 6 months ago
parent b3bac5c662
commit 9e1471c9d2

@ -40,7 +40,7 @@ ChatFilter = F.chat.id.in_(set(map(int, os.environ['USERS'].split(','))))
def format_tags(tags: Iterable[str]):
return ' '.join(f'#{tag}' for tag in tags) or 'None'
return ' '.join(f'#{re.sub(r"[^0-9a-zA-Z_]", "_", tag)}' for tag in tags) or 'None'
def recover_url(file: E621PostFile):

Loading…
Cancel
Save