-
-
Notifications
You must be signed in to change notification settings - Fork 402
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reddit: handle post and comment links in one regex
It's entirely impractical to try to handle post and comment links in separate callables, because comment links contain an entire post link. Before, this was handled by anchoring the post URL pattern at the end, but that broke Sopel handling e.g. `?sort=confidence` if someone sorted the comments before copying the link into IRC. Lookaround assertions didn't appear to prevent matching the post link contained in every comment link, so this solution seemed like the only way forward. It's a nice tidy dispatcher pattern, really.
- Loading branch information
Showing
1 changed file
with
18 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters