This sets the target of the "code" link to `_blank`, so that it will
open in a new tab in browsers. Because the GitHub page is a different
context from libreddit, and accessing the repository doesn't imply that
the user is finished browsing libreddit, this seemed reasonable. This
also changes the link from `spikecodes/libreddit` to
`libreddit/libreddit`.
* 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'.
* Fix 'all_posts_hidden_nsfw' when there are no posts.
If a search query yielded no results and the user set nsfw posts to be
hidden, libreddit would show 'All posts are hidden because they are NSFW.
Enable "Show NSFW posts" in settings to view'. This is fixed by
verifying tnat posts.len > 0 before setting 'all_posts_hidden_nsfw' to
true.
* Add a message when no posts were found.
* Delete 2
base.html will now request with a query parameter `v=` whose value is
the current version of Libreddit. This will cause the browser to request
the stylesheet for a specific version of Libreddit, bypassing the cache.
A new version of Libreddit will cause the browser to fetch a new
stylesheet.
Resolves#622. Credit is due to GitHub user @chloekek for offering this
solution in the following post:
https://github.com/libreddit/libreddit/issues/622#issuecomment-1315961742