mirror of
https://github.com/redlib-org/redlib.git
synced 2025-06-01 04:12:18 +00:00
Search - add support for raw reddit links (#663)
* Search - add support for raw reddit links If a search query starts with 'https://www.reddit.com/' or 'https://old.reddit.com/', this prefix will be truncated and the query will be processed normally. For example, a search query 'https://www.reddit.com/r/rust' will redirect to r/rust. * Search - support a wider variety of reddit links. Add once cell dependency for static regex support (avoid compiling the same regex multiple times). All search queries are now matched against a regex (provided by @Daniel-Valentine) that determines if it is a reddit link. If it is, the prefix specifying the reddit instance will be truncated from the query that will then be processed normally. For example, the query 'https://www.reddit.com/r/rust' will be treated the same way as the query 'r/rust'.
This commit is contained in:
parent
ab30b8bbec
commit
9e434e7db6
3 changed files with 9 additions and 1 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -677,6 +677,7 @@ dependencies = [
|
|||
"hyper-rustls",
|
||||
"libflate",
|
||||
"lipsum",
|
||||
"once_cell",
|
||||
"percent-encoding",
|
||||
"regex",
|
||||
"route-recognizer",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue