lib/nanoc/extra/checking/checks/internal_links.rb in nanoc-3.6.3 vs lib/nanoc/extra/checking/checks/internal_links.rb in nanoc-3.6.4
- old
+ new
@@ -1,7 +1,9 @@
# encoding: utf-8
+require 'uri'
+
module Nanoc::Extra::Checking::Checks
# A check that verifies that all internal links point to a location that exists.
class InternalLinks < ::Nanoc::Extra::Checking::Check
@@ -35,9 +37,12 @@
return true if path.empty?
# Remove query string
path = path.sub(/\?.*$/, '')
return true if path.empty?
+
+ # Decode URL (e.g. '%20' -> ' ')
+ path = URI.unescape(path)
# Make absolute
if path[0, 1] == '/'
path = @site.config[:output_dir] + path
else