瀏覽代碼

Merge pull request #1430 from scherepn/pytorch-fix

Fix broken PyTorch scraper
Simon Legner 5 年之前
父節點
當前提交
e6baef3593
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      lib/docs/filters/pytorch/entries.rb

+ 3 - 2
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)