~edwardloveall/scribe

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH] Exclude cdn-images in regex

Details
Message ID
<20220102023134.46092-1-austinhuang@disroot.org>
DKIM signature
missing
Download raw message
Patch: +1 -1
From: Austin Huang <im@austinhuang.me>

---
I let the redirect to apply to everything (since the FAQ did not specify advanced options), which breaks the images. Adding cdn-images exception would be more fool-proof, imo.

 src/pages/faq/index_page.cr | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pages/faq/index_page.cr b/src/pages/faq/index_page.cr
index 307f794..c1494e1 100644
--- a/src/pages/faq/index_page.cr
+++ b/src/pages/faq/index_page.cr
@@ -34,7 +34,7 @@ class Faq::IndexPage < MainLayout
        end
        li do
          strong "Include pattern: "
          code "^https?://(?:.*\\.)*(?<!link\\.)medium\\.com(/.*)?$"
          code "^https?://(?:(?!cdn-images-\d+).*\.)*(?<!link\.)medium\.com(/.*)?$"
        end
        li do
          strong "Redirect to: "
-- 
2.33.0
Details
Message ID
<FD326672-2638-4C2A-ABE5-1ACBF9C02144@edwardloveall.com>
In-Reply-To
<20220102023134.46092-1-austinhuang@disroot.org> (view parent)
DKIM signature
missing
Download raw message
Thanks Austin!

Thinking ahead a little, I wonder how many more of these domain exceptions there are and if it would make more sense to specify some advanced options instead of lengthening an already complex RegularExpression. You mentioned that this would be more fool-proof so it seems like you might have thought about this already.

Edward

On 1 Jan 2022, at 21:31, austinhuang@disroot.org wrote:

> From: Austin Huang <im@austinhuang.me>
>
> ---
> I let the redirect to apply to everything (since the FAQ did not specify advanced options), which breaks the images. Adding cdn-images exception would be more fool-proof, imo.
>
>  src/pages/faq/index_page.cr | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/pages/faq/index_page.cr b/src/pages/faq/index_page.cr
> index 307f794..c1494e1 100644
> --- a/src/pages/faq/index_page.cr
> +++ b/src/pages/faq/index_page.cr
> @@ -34,7 +34,7 @@ class Faq::IndexPage < MainLayout
>          end
>          li do
>            strong "Include pattern: "
> -          code "^https?://(?:.*\\.)*(?<!link\\.)medium\\.com(/.*)?$"
> +          code "^https?://(?:(?!cdn-images-\d+).*\.)*(?<!link\.)medium\.com(/.*)?$"
>          end
>          li do
>            strong "Redirect to: "
> -- 
> 2.33.0
Reply to thread Export thread (mbox)