Unified · Split
| @@ -17,7 +17,7 @@ module Docs · 16 unmodified lines | |||
| 17 | end | 17 | end |
| 18 | 18 | ||
| 19 | css('a.anchor', 'a.hashref').each do |node| | 19 | css('a.anchor', 'a.hashref').each do |node| |
| 20 | node.parent['id'] = node['name'] || node['id'] | 20 | node.parent['id'] ||= node['name'] || node['id'] |
| 21 | end | 21 | end |
| 22 | 22 | ||
| 23 | css('.highlight').each do |node| | 23 | css('.highlight').each do |node| |
| @@ -22,7 +22,8 @@ module Docs · 21 unmodified lines | |||
| 22 | name.remove! %r{\w+\:} | 22 | name.remove! %r{\w+\:} |
| 23 | name.strip! | 23 | name.strip! |
| 24 | name = 'createFragmentobject' if name.include?('createFragmentobject') | 24 | name = 'createFragmentobject' if name.include?('createFragmentobject') |
| 25 | id = node.parent.at_css('.anchor')['name'] | 25 | id = name.parameterize |
| 26 | node.parent['id'] = id | ||
| 26 | type = if slug == 'react-component' | 27 | type = if slug == 'react-component' |
| 27 | 'Reference: Component' | 28 | 'Reference: Component' |
| 28 | elsif slug == 'react-api' | 29 | elsif slug == 'react-api' |
| @@ -2,7 +2,7 @@ module Docs · 1 unmodified line | |||
| 2 | class React < UrlScraper | 2 | class React < UrlScraper |
| 3 | self.name = 'React' | 3 | self.name = 'React' |
| 4 | self.type = 'react' | 4 | self.type = 'react' |
| 5 | self.release = '15.4.2' | 5 | self.release = '15.5.0' |
| 6 | self.base_url = 'https://facebook.github.io/react/docs/' | 6 | self.base_url = 'https://facebook.github.io/react/docs/' |
| 7 | self.root_path = 'hello-world.html' | 7 | self.root_path = 'hello-world.html' |
| 8 | self.links = { | 8 | self.links = { |