Procházet zdrojové kódy

Update React Native documentation (0.19)

Thibaut Courouble před 10 roky
rodič
revize
5714492405

+ 6 - 0
lib/docs/filters/react/clean_html.rb

@@ -10,6 +10,12 @@ module Docs
 
         css('.docs-prevnext', '.hash-link', '.edit-page-link', '.edit-github').remove
 
+        css('table h1', 'table h2', 'table h3').each do |node|
+          table = node
+          table = table.parent until table.name == 'table'
+          table.replace(node)
+        end
+
         css('a.anchor').each do |node|
           node.parent['id'] = node['name']
         end

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

@@ -14,7 +14,7 @@ module Docs
       }
 
       def get_name
-        at_css('h1').child.content
+        at_css('h1').children.select(&:text?).map(&:content).join.strip
       end
 
       def get_type

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

@@ -3,7 +3,7 @@ module Docs
     self.name = 'React Native'
     self.slug = 'react_native'
     self.type = 'react'
-    self.release = '0.18'
+    self.release = '0.19'
     self.base_url = 'https://facebook.github.io/react-native/docs/'
     self.root_path = 'getting-started.html'
     self.links = {