History

Fix path encoding issues in C/C++ scraper

Fixes #767.

Thibaut Courouble committed 8 years ago

Commit e3ef1391 parent a54038c3 files · +5 −3Browse files

Unified · Split

3 files
  1. lib/docs/core/filter.rb +3 −1
  2. lib/docs/scrapers/c.rb +1 −1
  3. lib/docs/scrapers/cpp.rb +1 −1
lib/docs/core/filter.rb+3−1
@@ -103,7 +103,9 @@ module Docs · 102 unmodified lines
103 end103 end
104 104
105 def clean_path(path)105 def clean_path(path)
106 path.gsub %r{[!;:]+}, '-'106 path = path.gsub %r{[!;:]}, '-'
107 path = path.gsub %r{\+}, '_plus_'
108 path
107 end109 end
108 end110 end
109end111end
lib/docs/scrapers/c.rb+1−1
@@ -1,7 +1,7 @@
1module Docs1module Docs
2 class C < FileScraper2 class C < FileScraper
3 self.type = 'c'3 self.type = 'c'
4 self.dir = '/Users/Thibaut/DevDocs/Docs/C/c'4 self.dir = '/Users/Thibaut/DevDocs/Docs/c'
5 self.base_url = 'http://en.cppreference.com/w/c/'5 self.base_url = 'http://en.cppreference.com/w/c/'
6 self.root_path = 'header.html'6 self.root_path = 'header.html'
7 7
lib/docs/scrapers/cpp.rb+1−1
@@ -3,7 +3,7 @@ module Docs · 2 unmodified lines
3 self.name = 'C++'3 self.name = 'C++'
4 self.slug = 'cpp'4 self.slug = 'cpp'
5 self.type = 'c'5 self.type = 'c'
6 self.dir = '/Users/Thibaut/DevDocs/Docs/C/cpp'6 self.dir = '/Users/Thibaut/DevDocs/Docs/cpp'
7 self.base_url = 'http://en.cppreference.com/w/cpp/'7 self.base_url = 'http://en.cppreference.com/w/cpp/'
8 self.root_path = 'header.html'8 self.root_path = 'header.html'
9 9