jekyll-imgwh 1.1.1 → 1.2.0

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: 9d6e9502b9771b8cde54d20f222edbe9a3cd3882d275dda10b75c9d208e9fe7a
4
- data.tar.gz: 7faf66b11788dacee656ce7ba690e303b2abf72117e5b13b39d11a2323907cf0
3
+ metadata.gz: 97ed49b87d0bbe492af4ed8522310efabdc9746d7704dda82cbacd7b86aa23de
4
+ data.tar.gz: 3cf0726edda511915644e2c8fff32ef114caa347debf38a39ef20b0a59e2caf4
5
5
  SHA512:
6
- metadata.gz: a442ba4d09a91ab85d776e7b64820eeb46de0dfbc8415c7f3617db6cf7b9f4871496549825abed99c385a1a5867f820216fc1ef25063d52df6961ffd881e51ca
7
- data.tar.gz: 1b5c3871cd747afa49319b50f85ddf3eb16615b9b08e69c54208bc51cc2a9391ef3e0452a906bd94fff7f35734a216895bf4d01301010d10fca5bbcda40bdca2
6
+ metadata.gz: 46cd039ca46ee40493efde196c88e47970c85f422c7e061af8403119cb946571770e1a84d0239d20c5aa2aee3f003102e6cc2640e7c1c9b22ebacfbd5001ce56
7
+ data.tar.gz: 5c259abe5bf29223445f2b2a59f151076015847b97ef740f4730ffc64ea6374e4e62e431e046bea936f0d0926e3c46d0290d0f7ed5937ec97bd4c6c35e003596
@@ -3,6 +3,6 @@
3
3
  module Jekyll
4
4
  module Imgwh
5
5
  NAME = "jekyll-imgwh"
6
- VERSION = "1.1.1"
6
+ VERSION = "1.2.0"
7
7
  end
8
8
  end
data/lib/jekyll-imgwh.rb CHANGED
@@ -53,11 +53,15 @@ module Jekyll
53
53
  uri = URI(src)
54
54
 
55
55
  if uri.scheme.nil?
56
- path = resolve_path(CGI.unescape(uri.path), context)
57
- FastImage.size(path) or raise LoadError, "#{NAME}: could not get size of image '#{path}'"
56
+ src = resolve_path(CGI.unescape(uri.path), context)
58
57
  else
59
- raise ArgumentError, "#{NAME}: URIs with '#{uri.scheme}' scheme are not allowed"
58
+ allowed_schemes = context.registers[:site].config.dig(NAME, "allowed_schemes") || []
59
+ unless allowed_schemes.include?(uri.scheme)
60
+ raise ArgumentError, "#{NAME}: URIs with '#{uri.scheme}' scheme are not allowed"
61
+ end
60
62
  end
63
+
64
+ FastImage.size(src) or raise LoadError, "#{NAME}: could not get size of image '#{src}'"
61
65
  end
62
66
 
63
67
  def render_rest(context)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-imgwh
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikalai Ananenka