~edwardloveall/scribe

Exclude cdn-images in regex v1 PROPOSED

: 1
 Exclude cdn-images in regex

 1 files changed, 1 insertions(+), 1 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~edwardloveall/scribe/patches/27883/mbox | git am -3
Learn more about email & git

[PATCH] Exclude cdn-images in regex Export this patch

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
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