sanitize hashtags

This commit is contained in:
bakatrouble 2023-11-13 01:09:51 +03:00
parent b3bac5c662
commit 9e1471c9d2

View File

@ -40,7 +40,7 @@ ChatFilter = F.chat.id.in_(set(map(int, os.environ['USERS'].split(','))))
def format_tags(tags: Iterable[str]): 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): def recover_url(file: E621PostFile):