Fix Haskell entry names
Unified · Split
| @@ -53,19 +53,15 @@ module Docs · 52 unmodified lines | ||
| 53 | 53 | return [] if IGNORE_ENTRIES_PATHS.include?(subpath.split('/').last) |
| 54 | 54 | |
| 55 | 55 | css('#synopsis > details > ul > li').each_with_object [] do |node, entries| |
| 56 | − link = node.at_css('a') | |
| 57 | − name = node.content.strip | |
| 58 | − name.remove! %r{\A(?:module|data|newtype|class|type family m|type)\s+} | |
| 59 | − name.sub! %r{\A\((.+?)\)}, '\1' | |
| 60 | − name.sub!(/ (?:\:\: (\w+))?.*\z/) { |_| $1 ? " (#{$1})" : '' } | |
| 56 | + link = node.at_css('a:not([title])') | |
| 57 | + name = link.content | |
| 61 | 58 | |
| 62 | 59 | if ADD_SUB_ENTRIES_KEYWORDS.include?(node.at_css('.keyword').try(:content)) |
| 63 | 60 | node.css('.subs > li').each do |sub_node| |
| 64 | 61 | sub_link = sub_node.at_css('a') |
| 65 | 62 | next unless sub_link['href'].start_with?('#') |
| 66 | − sub_name = sub_node.content.strip | |
| 67 | − sub_name.remove! %r{\s.*} | |
| 68 | − sub_name.prepend "#{name} " | |
| 63 | + sub_name = sub_link.content | |
| 64 | + sub_name << " (#{name})" | |
| 69 | 65 | entries << [sub_name, sub_link['href'].remove('#')] |
| 70 | 66 | end |
| 71 | 67 | end |