Unified · Split
| @@ -14,24 +14,32 @@ module Docs · 13 unmodified lines | ||
| 14 | 14 | '.anchor', '.toc-jump', '.source-code-links', '.user-notes', |
| 15 | 15 | '.show-more', '.hide-more').remove |
| 16 | 16 | |
| 17 | − br = /<br\s?\/?>/i | |
| 18 | − | |
| 19 | 17 | header = at_css('h1') |
| 20 | 18 | header.content = header.content.strip |
| 21 | 19 | doc.prepend_child header |
| 22 | 20 | |
| 21 | + # Remove permalink | |
| 22 | + css('h2 > a, h3 > a').each do |node| | |
| 23 | + node.parent.remove_attribute('class') | |
| 24 | + node.parent.remove_attribute('tabindex') | |
| 25 | + node.parent.content = node.content | |
| 26 | + end | |
| 27 | + | |
| 23 | 28 | # Add PHP code highlighting |
| 24 | 29 | css('pre').each do |node| |
| 25 | 30 | node['data-language'] = 'php' |
| 26 | 31 | end |
| 27 | 32 | |
| 28 | 33 | css('.source-code-container').each do |node| |
| 34 | + node.remove_class('source-code-container') | |
| 29 | 35 | node.name = 'pre' |
| 30 | − node.inner_html = node.inner_html.gsub(br, "\n") | |
| 36 | + node.inner_html = node.inner_html.gsub(/<br\s?\/?>/i, "\n") | |
| 31 | 37 | node.content = node.content.strip |
| 32 | 38 | node['data-language'] = 'php' |
| 33 | 39 | end |
| 34 | 40 | |
| 41 | + css('section').remove_attribute('class') | |
| 42 | + | |
| 35 | 43 | doc |
| 36 | 44 | end |
| 37 | 45 | end |
| @@ -2,7 +2,7 @@ module Docs · 1 unmodified line | ||
| 2 | 2 | class Wordpress < UrlScraper |
| 3 | 3 | self.name = 'WordPress' |
| 4 | 4 | self.type = 'wordpress' |
| 5 | − self.release = '5.9' | |
| 5 | + self.release = '6.0' | |
| 6 | 6 | self.base_url = 'https://developer.wordpress.org/reference/' |
| 7 | 7 | self.initial_paths = %w( |
| 8 | 8 | functions/ |