Skip to content

Commit

Permalink
feat(parsing.utils): support chat-specific hashtags by allowing '@'
Browse files Browse the repository at this point in the history
Telegram recently added a feature called "chat-specific hashtags,"
formatting as `#hashtag@username`. However, '@' was escaped, resulting
in these hashtags being broken.

Properly supports such hashtags by allowing '@' in hashtags.

Signed-off-by: Rongrong <[email protected]>
  • Loading branch information
Rongronggg9 committed Nov 6, 2024
1 parent 067606b commit b186b68
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/parsing/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@
sorted(
# Known characters that break hashtags. Though '・' breaks hashtags, it is not the case of '·'.
set(chain(SPACES, INVALID_CHARACTERS, string.punctuation, string.whitespace, '・'))
# Characters included in `string.punctuation` but valid in hashtags.
- set('@')
)
)

Expand Down

0 comments on commit b186b68

Please sign in to comment.