1
0
Эх сурвалжийг харах

Update React documentation (15.5.0)

Thibaut Courouble 8 жил өмнө
parent
commit
a3e65fc784

+ 1 - 1
lib/docs/filters/react/clean_html.rb

@@ -17,7 +17,7 @@ module Docs
         end
 
         css('a.anchor', 'a.hashref').each do |node|
-          node.parent['id'] = node['name'] || node['id']
+          node.parent['id'] ||= node['name'] || node['id']
         end
 
         css('.highlight').each do |node|

+ 2 - 1
lib/docs/filters/react/entries.rb

@@ -22,7 +22,8 @@ module Docs
           name.remove! %r{\w+\:}
           name.strip!
           name = 'createFragmentobject' if name.include?('createFragmentobject')
-          id = node.parent.at_css('.anchor')['name']
+          id = name.parameterize
+          node.parent['id'] = id
           type = if slug == 'react-component'
             'Reference: Component'
           elsif slug == 'react-api'

+ 1 - 1
lib/docs/scrapers/react.rb

@@ -2,7 +2,7 @@ module Docs
   class React < UrlScraper
     self.name = 'React'
     self.type = 'react'
-    self.release = '15.4.2'
+    self.release = '15.5.0'
     self.base_url = 'https://facebook.github.io/react/docs/'
     self.root_path = 'hello-world.html'
     self.links = {