From 0070a6f2afd68df61bb7cd234b4651ff78a17697 Mon Sep 17 00:00:00 2001 From: murata0705 Date: Mon, 18 Feb 2019 14:43:30 +0900 Subject: [PATCH] Fix toc link not working on github --- lib/prmd/templates/schemata.md.erb | 2 +- lib/prmd/templates/schemata/link.md.erb | 2 +- lib/prmd/templates/table_of_contents.erb | 2 +- test/commands/render_test.rb | 5 +++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/prmd/templates/schemata.md.erb b/lib/prmd/templates/schemata.md.erb index 916b3502..98863946 100644 --- a/lib/prmd/templates/schemata.md.erb +++ b/lib/prmd/templates/schemata.md.erb @@ -9,7 +9,7 @@ title = schemata['title'].split(' - ', 2).last -%> <%- unless options[:doc][:disable_title_and_description] %> - + ## <%= title %> <%- if schemata['stability'] && !schemata['stability'].empty? %> diff --git a/lib/prmd/templates/schemata/link.md.erb b/lib/prmd/templates/schemata/link.md.erb index 00520b54..a5cb891f 100644 --- a/lib/prmd/templates/schemata/link.md.erb +++ b/lib/prmd/templates/schemata/link.md.erb @@ -3,7 +3,7 @@ response_example = link['response_example'] link_schema_properties_template = Prmd::Template.load_template('link_schema_properties.md.erb', options[:template]) -%> - + ### <%= title %> <%= link['title'] %>
diff --git a/lib/prmd/templates/table_of_contents.erb b/lib/prmd/templates/table_of_contents.erb index 718807bb..496f63b1 100644 --- a/lib/prmd/templates/table_of_contents.erb +++ b/lib/prmd/templates/table_of_contents.erb @@ -6,6 +6,6 @@ <% _, schemata = schema.dereference(property) %> - <%= schemata['title'].split(' - ', 2).last %> <% schemata.fetch('links', []).each do |l| %> - - <%= l['method'] %> <%= build_link_path(schema, l) %> + - <%= l['method'] %> <%= build_link_path(schema, l) %> <% end %> <% end %> diff --git a/test/commands/render_test.rb b/test/commands/render_test.rb index 68e6f581..5cb14876 100644 --- a/test/commands/render_test.rb +++ b/test/commands/render_test.rb @@ -39,8 +39,9 @@ def test_render_for_toc assert_match /^## The table of contents/, markdown assert_match 'POST /apps', markdown - assert_match '', markdown + assert_match 'POST /apps', markdown + assert_match '', markdown end def test_render_for_example_as_an_array