nanoc-checking 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 89d7860391ed030af4773bd204ce6a94b7c76b966c42b2384efb53619f5b33f4
4
- data.tar.gz: c60649c0f1f12ca8475f4c06e47348fa39dc599dcfc30c21f06e801f15f942df
3
+ metadata.gz: 1c6b1465b1a9ecccbc3535c98539c4caa56526f8ea5a02ae978bba6f5e7301e1
4
+ data.tar.gz: dd6a2ca940a81ba5706e2264df87029fc8a2a943036d2a5f5480098266dfb85c
5
5
  SHA512:
6
- metadata.gz: 3db4309a8fbd02942f9d8cd3db83701779ae44fd0f0e32cb92cdfc4569a3c05572ad52e309317ce911e7fd1775afe255b1c1fba4e2ff90d150716ab7f48e6d3e
7
- data.tar.gz: 2e5839f8e46c65adf9721ab8eb29a09ea8734204eaa83475fb83ec66c87d0dcb440d5dc4fe06a3f476e7336f78d0af39d095d11657712f32c6473709c77e3e33
6
+ metadata.gz: e99b1d95e7c766af4122c3eb094e084c1c28f7b7545a2a83650e87f09ac68e33f00b72972bf000fef0c5567aa9e357d3057ca026aff15293b8af9061bfc85674
7
+ data.tar.gz: 73bd648e7069753428c69fcca5d0b73c94c2f85c8406952f9d40fe1ee50c4a4274f001fd9477c4be17abc59a0990e3924153e71afac5e03bd0d733f2c502a9d8
data/NEWS.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # nanoc-checking news
2
2
 
3
+ ## 1.0.5 (2024-04-21)
4
+
5
+ Fixes:
6
+
7
+ - Fixed support for paths with spaces in internal_links check (#1702)
8
+
9
+ ## 1.0.4 (2024-04-19)
10
+
11
+ Enhancements:
12
+
13
+ - Added support for `javascript:` pseudo-URLs (#1698)
14
+
3
15
  ## 1.0.3 (2024-03-15)
4
16
 
5
17
  Fixes:
@@ -43,6 +43,13 @@ module Nanoc
43
43
  end
44
44
 
45
45
  def validate(href)
46
+ # Skip javascript: URLs
47
+ #
48
+ # This needs to be handled explicitly, because URI.parse does not
49
+ # like `javascript:` URLs -- presumably because those are not
50
+ # technically valid URLs.
51
+ return nil if href.start_with?('javascript:')
52
+
46
53
  # Parse
47
54
  url = nil
48
55
  begin
@@ -43,7 +43,8 @@ module Nanoc
43
43
 
44
44
  output_dir = @config.output_dir
45
45
  output_dir += '/' unless output_dir.end_with?('/')
46
- base_uri = URI("file://#{output_dir}")
46
+ # FIXME: escape is hacky
47
+ base_uri = URI("file://#{output_dir.gsub(' ', '%20')}")
47
48
  path = href.sub(/#{base_uri}/, '').sub(/file:\/{1,3}/, '')
48
49
 
49
50
  path = "/#{path}" unless path.start_with?('/')
@@ -23,8 +23,6 @@ module ::Nanoc
23
23
  GLOBAL_ATTRS = %i[about resource].freeze
24
24
 
25
25
  def initialize(filenames, mode = nil)
26
- Nanoc::Extra::JRubyNokogiriWarner.check_and_warn
27
-
28
26
  @filenames = filenames
29
27
  @filter =
30
28
  case mode
@@ -85,7 +83,8 @@ module ::Nanoc
85
83
 
86
84
  def uris_in_file(filename, tag_names)
87
85
  uris = Set.new
88
- base_uri = URI("file://#{filename}")
86
+ # FIXME: escape is hacky
87
+ base_uri = URI("file://#{filename.gsub(' ', '%20')}")
89
88
  doc = Nokogiri::HTML(::File.read(filename))
90
89
  doc.traverse do |tag|
91
90
  next unless tag_names.nil? || tag_names.include?(tag.name)
@@ -118,7 +117,8 @@ module ::Nanoc
118
117
  uri
119
118
  else
120
119
  begin
121
- URI.join(base_uri, uri).to_s
120
+ # FIXME: escape is hacky
121
+ URI.join(base_uri, uri.gsub(' ', '%20')).to_s
122
122
  rescue
123
123
  uri
124
124
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Nanoc
4
4
  module Checking
5
- VERSION = '1.0.3'
5
+ VERSION = '1.0.5'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nanoc-checking
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Defreyne
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-15 00:00:00.000000000 Z
11
+ date: 2024-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nanoc-cli
@@ -83,7 +83,7 @@ licenses:
83
83
  - MIT
84
84
  metadata:
85
85
  rubygems_mfa_required: 'true'
86
- source_code_uri: https://github.com/nanoc/nanoc/tree/nanoc-checking-v1.0.3/nanoc-checking
86
+ source_code_uri: https://github.com/nanoc/nanoc/tree/nanoc-checking-v1.0.5/nanoc-checking
87
87
  post_install_message:
88
88
  rdoc_options: []
89
89
  require_paths:
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
99
  - !ruby/object:Gem::Version
100
100
  version: '0'
101
101
  requirements: []
102
- rubygems_version: 3.5.3
102
+ rubygems_version: 3.5.9
103
103
  signing_key:
104
104
  specification_version: 4
105
105
  summary: Checking support for Nanoc