From 68790116783aff9d6c55eb52df6c6a35f4368ffd Mon Sep 17 00:00:00 2001 From: Achilleas Pipinellis Date: Fri, 7 Dec 2018 16:29:17 +0100 Subject: Make sure we pick up URLs pointing to anchor links Remove the strict regex ending in .md, since redirect URLs can also point to an anchor link. --- Rules | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'Rules') diff --git a/Rules b/Rules index 286454b4..93d6423d 100644 --- a/Rules +++ b/Rules @@ -21,9 +21,7 @@ preprocess do # Capture the intended page so the redirect page can redirect to it. item[:redirect_to] = item.raw_content.match(/^This document was moved to \[.*\]\((.*)\)/m)[1] # If the provided URL is in Markdown, correct it to HTML. - if item[:redirect_to].to_s.match(/.md$/) - item[:redirect_to] = item[:redirect_to].gsub!(/\.md/, '.html') - end + item[:redirect_to] = item[:redirect_to].gsub!(/\.md/, '.html') if item[:redirect_to].to_s.match(/.md/) end end -- cgit v1.2.3