Makes it work in more scenarios, and also removes the stropping
Unified · Split
| @@ -54,8 +54,8 @@ module Docs · 53 unmodified lines | ||
| 54 | 54 | else |
| 55 | 55 | |
| 56 | 56 | css('.simple-toc-section a, .nested-toc-section a').each do |node| |
| 57 | − entry_name = node.content | |
| 58 | − entry_name.gsub!(/(\(|\[).*/, '') | |
| 57 | + match = /^`(.*)`|^(\w+)/.match(node.content) | |
| 58 | + entry_name = match[1] || match[2] | |
| 59 | 59 | |
| 60 | 60 | entry_id = slug + node['href'] |
| 61 | 61 | entries << [entry_name, entry_id, name] |