From 9bb7fc71179d2da4227aa4649e3ec6e429c880c2 Mon Sep 17 00:00:00 2001 From: Marc Anguera Insa Date: Sun, 5 May 2024 18:44:54 +0200 Subject: [PATCH] move comment to related line --- lib/middleman-blog/uri_templates.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/middleman-blog/uri_templates.rb b/lib/middleman-blog/uri_templates.rb index d82e55c..a0cd666 100644 --- a/lib/middleman-blog/uri_templates.rb +++ b/lib/middleman-blog/uri_templates.rb @@ -76,10 +76,13 @@ def safe_parameterize(str, sep = '-') # Remove leading/trailing separator. parameterized_string.gsub!(/^#{re_sep}|#{re_sep}$/, '') + + # Replace all _ with - parameterized_string.tr!('_', '-') + + # Delete all ? parameterized_string.delete!('?') - # Replace all ? parameterized_string end