Fixes #2567.
Unified · Split
| @@ -11,9 +11,7 @@ module Docs · 10 unmodified lines | |||
| 11 | end | 11 | end |
| 12 | 12 | ||
| 13 | def additional_entries | 13 | def additional_entries |
| 14 | entries = [] | 14 | css('h3 > code, h4 > code, h5 > code, h6 > code').each_with_object [] do |node, entries| |
| 15 | |||
| 16 | css('h3 > code, h4 > code, h5 > code, h6 > code').each do |node| | ||
| 17 | name = node.content.gsub(/\(.*\)/, '()') | 15 | name = node.content.gsub(/\(.*\)/, '()') |
| 18 | id = node.parent['id'] | 16 | id = node.parent['id'] |
| 19 | 17 | ||
| @@ -24,15 +22,15 @@ module Docs · 4 unmodified lines | |||
| 24 | entries << ["Event #{name}", id, type] | 22 | entries << ["Event #{name}", id, type] |
| 25 | end | 23 | end |
| 26 | 24 | ||
| 27 | if node.parent.child.is_a?(Nokogiri::XML::Text) | 25 | if node.parent.child.is_a?(Nokogiri::XML::Text) && !node.parent.child.content.include?('Static method:') |
| 28 | next | 26 | next |
| 27 | elsif entries.select {|entry| entry[0] == name}.first | ||
| 28 | entries << [node.content, id, type] | ||
| 29 | else | 29 | else |
| 30 | entries << [name, id, type] | 30 | entries << [name, id, type] |
| 31 | end | 31 | end |
| 32 | 32 | ||
| 33 | end | 33 | end |
| 34 | |||
| 35 | entries | ||
| 36 | end | 34 | end |
| 37 | 35 | ||
| 38 | end | 36 | end |