From b13afc4178367d801fc21efa6a4501ce860bc43c Mon Sep 17 00:00:00 2001 From: elij Date: Mon, 12 Aug 2013 19:02:43 -0700 Subject: [PATCH 1/2] fix sanitizeRegex to not strip "dots" sanitizeRegex was stripping dots in permalinks when generating RenderIndexes (noted during feed/rss generation). permalink was being set to `.../indexxml` instead of `.../index.xml`. Adding "dot" to the regex whitelist fixed the issue. --- hugolib/helpers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hugolib/helpers.go b/hugolib/helpers.go index b2eb39673..80f92c875 100644 --- a/hugolib/helpers.go +++ b/hugolib/helpers.go @@ -27,7 +27,7 @@ import ( "time" ) -var sanitizeRegexp = regexp.MustCompile("[^a-zA-Z0-9/_-]") +var sanitizeRegexp = regexp.MustCompile("[^a-zA-Z0-9/_-.]") // TODO: Make these wrappers private // Wrapper around Fprintf taking verbose flag in account. From 31a1ade1b4eb12003a1ee31a2abf4407cc0c7285 Mon Sep 17 00:00:00 2001 From: elij Date: Mon, 12 Aug 2013 19:55:52 -0700 Subject: [PATCH 2/2] move "dot" in regex to avoid it being part of a range --- hugolib/helpers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hugolib/helpers.go b/hugolib/helpers.go index 80f92c875..c814a6289 100644 --- a/hugolib/helpers.go +++ b/hugolib/helpers.go @@ -27,7 +27,7 @@ import ( "time" ) -var sanitizeRegexp = regexp.MustCompile("[^a-zA-Z0-9/_-.]") +var sanitizeRegexp = regexp.MustCompile("[^a-zA-Z0-9./_-]") // TODO: Make these wrappers private // Wrapper around Fprintf taking verbose flag in account.