Unified · Split
| @@ -8,14 +8,14 @@ module Docs · 7 unmodified lines | |||
| 8 | 8 | ||
| 9 | def get_name | 9 | def get_name |
| 10 | if slug.start_with? 'Global_Objects/' | 10 | if slug.start_with? 'Global_Objects/' |
| 11 | name, method = *slug.sub('Global_Objects/', '').split('/') | 11 | name, method, *rest = *slug.sub('Global_Objects/', '').split('/') |
| 12 | name.prepend 'Intl.' if INTL_OBJECTS.include?(name) | 12 | name.prepend 'Intl.' if INTL_OBJECTS.include?(name) |
| 13 | 13 | ||
| 14 | if method | 14 | if method |
| 15 | unless method == method.upcase || method == 'NaN' | 15 | unless method == method.upcase || method == 'NaN' |
| 16 | method = method[0].downcase + method[1..-1] # e.g. Trim => trim | 16 | method = method[0].downcase + method[1..-1] # e.g. Trim => trim |
| 17 | end | 17 | end |
| 18 | name << ".#{method}" | 18 | name << ".#{([method] + rest).join('.')}" |
| 19 | end | 19 | end |
| 20 | 20 | ||
| 21 | name | 21 | name |
| @@ -20,7 +20,7 @@ module Docs · 19 unmodified lines | |||
| 20 | node.before(node.children).remove | 20 | node.before(node.children).remove |
| 21 | end | 21 | end |
| 22 | 22 | ||
| 23 | css('h2[style]', 'pre[style]').remove_attr('style') | 23 | css('h2[style]', 'pre[style]', 'th[style]', 'div[style*="line-height"]').remove_attr('style') |
| 24 | 24 | ||
| 25 | doc | 25 | doc |
| 26 | end | 26 | end |
| @@ -35,6 +35,8 @@ module Docs · 34 unmodified lines | |||
| 35 | /Operators | 35 | /Operators |
| 36 | /Statements) | 36 | /Statements) |
| 37 | 37 | ||
| 38 | options[:skip_patterns] = [/additional_examples/i, /noSuchMethod/i] | ||
| 39 | |||
| 38 | options[:fix_urls] = ->(url) do | 40 | options[:fix_urls] = ->(url) do |
| 39 | url.sub! 'https://developer.mozilla.org/en-US/docs/JavaScript/Reference', Javascript.base_url | 41 | url.sub! 'https://developer.mozilla.org/en-US/docs/JavaScript/Reference', Javascript.base_url |
| 40 | url.sub! 'https://developer.mozilla.org/en/JavaScript/Reference', Javascript.base_url | 42 | url.sub! 'https://developer.mozilla.org/en/JavaScript/Reference', Javascript.base_url |