From d51a6f904265352a0d38a1ac41740c4a8e410cf4 Mon Sep 17 00:00:00 2001 From: Thibaut Date: Sun, 26 Jan 2014 15:35:55 -0500 Subject: [PATCH] Replace colons with dashes in internal URL paths --- lib/docs/filters/core/normalize_paths.rb | 1 + test/lib/docs/filters/core/normalize_paths_test.rb | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/lib/docs/filters/core/normalize_paths.rb b/lib/docs/filters/core/normalize_paths.rb index c78ce0c2..f920ffd0 100644 --- a/lib/docs/filters/core/normalize_paths.rb +++ b/lib/docs/filters/core/normalize_paths.rb @@ -34,6 +34,7 @@ module Docs def normalize_path(path) path = path.downcase + path.gsub! ':', '-' if path == '.' 'index' diff --git a/test/lib/docs/filters/core/normalize_paths_test.rb b/test/lib/docs/filters/core/normalize_paths_test.rb index b3fc120d..c8f480c7 100644 --- a/test/lib/docs/filters/core/normalize_paths_test.rb +++ b/test/lib/docs/filters/core/normalize_paths_test.rb @@ -55,6 +55,10 @@ class NormalizePathsFilterTest < MiniTest::Spec it "returns 'test' with 'test.html'" do assert_equal 'test', filter.normalize_path('test.html') end + + it "returns 'te-st' with 'te:st'" do + assert_equal 'te-st', filter.normalize_path('te:st') + end end before do