diff --git a/lib/pact/doc/markdown/index_renderer.rb b/lib/pact/doc/markdown/index_renderer.rb index 92945c5b..66ad1d9c 100644 --- a/lib/pact/doc/markdown/index_renderer.rb +++ b/lib/pact/doc/markdown/index_renderer.rb @@ -1,3 +1,5 @@ +require 'erb' + module Pact module Doc module Markdown @@ -32,7 +34,7 @@ def title end def item title, file_name - "* [#{title}](#{file_name})" + "* [#{title}](#{ERB::Util.url_encode(file_name)})" end end diff --git a/spec/support/generated_index.md b/spec/support/generated_index.md index 3e146a00..befffaeb 100644 --- a/spec/support/generated_index.md +++ b/spec/support/generated_index.md @@ -1,4 +1,4 @@ ### Pacts for Some Consumer -* [Some Provider](Some Provider.md) -* [Some other provider](Some other provider.md) +* [Some Provider](Some%20Provider.md) +* [Some other provider](Some%20other%20provider.md)