[devdocsgjs/main: 1384/1867] Fix broken PyTorch scraper




commit fa407af6aaff8d8daf222d3116cd703b9c11c79b
Author: Phil Scherer <pnscher evoforge org>
Date:   Mon Dec 14 21:13:30 2020 +0000

    Fix broken PyTorch scraper
    
    Fixes #1429

 lib/docs/filters/pytorch/entries.rb | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/lib/docs/filters/pytorch/entries.rb b/lib/docs/filters/pytorch/entries.rb
index c7168f0e..8a019b14 100644
--- a/lib/docs/filters/pytorch/entries.rb
+++ b/lib/docs/filters/pytorch/entries.rb
@@ -13,8 +13,9 @@ module Docs
         # The id of the container `div.section` indicates the page type.
         # If the id starts with `module-`, then it's an API reference,
         # otherwise it is a note or design doc.
-        if at_css('.section')['id'].starts_with? 'module-'
-          /\Amodule-(.*)/.match(article_id)[1]
+        section_id = at_css('.section')['id']
+        if section_id.starts_with? 'module-'
+          section_id.remove('module-')
         else
           name = get_breadcrumbs()[1]
           NAME_REPLACEMENTS.fetch(name, name)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]