فهرست منبع

Fix path encoding issues in C/C++ scraper

Fixes #767.
Thibaut Courouble 7 سال پیش
والد
کامیت
e3ef139111
3فایلهای تغییر یافته به همراه5 افزوده شده و 3 حذف شده
  1. 3 1
      lib/docs/core/filter.rb
  2. 1 1
      lib/docs/scrapers/c.rb
  3. 1 1
      lib/docs/scrapers/cpp.rb

+ 3 - 1
lib/docs/core/filter.rb

@@ -103,7 +103,9 @@ module Docs
     end
 
     def clean_path(path)
-      path.gsub %r{[!;:]+}, '-'
+      path = path.gsub %r{[!;:]}, '-'
+      path = path.gsub %r{\+}, '_plus_'
+      path
     end
   end
 end

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

@@ -1,7 +1,7 @@
 module Docs
   class C < FileScraper
     self.type = 'c'
-    self.dir = '/Users/Thibaut/DevDocs/Docs/C/c'
+    self.dir = '/Users/Thibaut/DevDocs/Docs/c'
     self.base_url = 'http://en.cppreference.com/w/c/'
     self.root_path = 'header.html'
 

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

@@ -3,7 +3,7 @@ module Docs
     self.name = 'C++'
     self.slug = 'cpp'
     self.type = 'c'
-    self.dir = '/Users/Thibaut/DevDocs/Docs/C/cpp'
+    self.dir = '/Users/Thibaut/DevDocs/Docs/cpp'
     self.base_url = 'http://en.cppreference.com/w/cpp/'
     self.root_path = 'header.html'