Browse Source

Handle underscores in markdown output too

master
Stu Franks 1 month ago
parent
commit
a7395b8e0f
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      lib/01-menu.rb

+ 1
- 1
lib/01-menu.rb View File

@@ -26,7 +26,7 @@ module MenuTextHelper
p = "#{site_url}#{path.join('/')}/#{a}"
i = @items[%r{.*#{p}}]

out.concat("#{' ' * depth}- [#{i[:title] || a.gsub('.md', '').split('-').map(&:capitalize).join(' ')}](#{i[:path]})\n")
out.concat("#{' ' * depth}- [#{i[:title] || a.gsub('.md', '').gsub('_', '-').split('-').map(&:capitalize).join(' ')}](#{i[:path]})\n")
else
# Prettify directory name (replace - with spaces and capitalise words)
d = a[:data].split('-').map(&:capitalize).join(' ')


Loading…
Cancel
Save