Skip to content

Commit

Permalink
fix: URL escape file paths in index of generated markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Apr 15, 2018
1 parent 230f1e3 commit 6af19d5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lib/pact/doc/markdown/index_renderer.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'erb'

module Pact
module Doc
module Markdown
Expand Down Expand Up @@ -32,7 +34,7 @@ def title
end

def item title, file_name
"* [#{title}](#{file_name})"
"* [#{title}](#{ERB::Util.url_encode(file_name)})"
end

end
Expand Down
4 changes: 2 additions & 2 deletions spec/support/generated_index.md
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 6af19d5

Please sign in to comment.