Fixes #1921.
Unified · Split
| @@ -40,21 +40,7 @@ module Docs · 39 unmodified lines | |||
| 40 | 40 | ||
| 41 | css('table[class^=index-] td[valign=top] > a').each_slice(2) do |entry_node, section_node| | 41 | css('table[class^=index-] td[valign=top] > a').each_slice(2) do |entry_node, section_node| |
| 42 | entry_name = entry_node.content | 42 | entry_name = entry_node.content |
| 43 | 43 | entry_path = entry_node['href'] | |
| 44 | page = section_node['href'].split('#')[0] | ||
| 45 | hash = entry_name | ||
| 46 | |||
| 47 | # The Special Parameters page has multiple additional entries which should link to the same paragraph | ||
| 48 | # Example: the documentation for "$!" is equal to the documentation for "!" | ||
| 49 | if page == 'special-parameters' | ||
| 50 | if hash.size > 1 && hash[0] == '$' | ||
| 51 | hash = hash[1..-1] | ||
| 52 | end | ||
| 53 | end | ||
| 54 | |||
| 55 | # Construct path to the page which the index links to | ||
| 56 | entry_path = page + '#' + hash | ||
| 57 | |||
| 58 | entries << [entry_name, entry_path, entry_type] | 44 | entries << [entry_name, entry_path, entry_type] |
| 59 | end | 45 | end |
| 60 | 46 | ||