Browse Source

Update Angular.js documentation (1.5.8, 1.4.12, 1.3.20, 1.2.30)

Fixes #440.
Thibaut Courouble 9 years ago
parent
commit
b9b41d0e69
2 changed files with 4 additions and 5 deletions
  1. 0 1
      lib/docs/filters/core/internal_urls.rb
  2. 4 4
      lib/docs/scrapers/angularjs.rb

+ 0 - 1
lib/docs/filters/core/internal_urls.rb

@@ -39,7 +39,6 @@ module Docs
     def to_internal_url(str)
       return unless (url = parse_url(str)) && (subpath = subpath_to(url))
       normalize_subpath(subpath)
-      subpath = URI.unescape(subpath) if context[:decode_and_clean_paths]
       return if skip_subpath?(subpath)
       normalize_url(url, subpath)
       url

+ 4 - 4
lib/docs/scrapers/angularjs.rb

@@ -22,10 +22,10 @@ module Docs
     options[:fix_urls] = ->(url) do
       %w(api guide).each do |str|
         url.sub! "/partials/#{str}/#{str}/", "/partials/#{str}/"
-        url.sub! %r{/#{str}/img/}, "/img/"
+        url.sub! %r{/#{str}/img/}, '/img/'
         url.sub! %r{/#{str}/(.+?)/#{str}/}, "/#{str}/"
         url.sub! %r{/partials/#{str}/(.+?)(?<!\.html)(?:\z|(#.*))}, "/partials/#{str}/\\1.html\\2"
-        url.sub! %r{/partials/.+/#{str}/}, "/partials/#{str}/"
+        url.sub! %r{/partials/(?!img).+/#{str}/}, "/partials/#{str}/"
       end
       url
     end
@@ -46,7 +46,7 @@ module Docs
     end
 
     version '1.5' do
-      self.release = '1.5.7'
+      self.release = '1.5.8'
       self.base_url = "https://code.angularjs.org/#{release}/docs/partials/"
     end
 
@@ -61,7 +61,7 @@ module Docs
     end
 
     version '1.2' do
-      self.release = '1.2.29'
+      self.release = '1.2.30'
       self.base_url = "https://code.angularjs.org/#{release}/docs/partials/"
     end
   end