jekyll-ical-tag 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cdb49ea6fd0b6d006435344649a8a7d30f19155f7e1424683d8774b59e9bdcf2
4
- data.tar.gz: e323590a17d904763e2169446a2152b24eeb90629fd4f88bba0adbac1bde523c
3
+ metadata.gz: a3390276b35fd0dd3b56ad571b8f780d2a34392d9bc2bf96e8598bc60a6ee2b8
4
+ data.tar.gz: 419bf7845e4bf1eafee30201c2a601676511b1938b5e4f277af6197eef7c7c80
5
5
  SHA512:
6
- metadata.gz: 6b3abd193f1de3eea850f2218ad8f42b7186e889b9915335a5da89418d59913898e09dc84e9f1d5fcf858eff2e9f49d4e0b960494fa2d930e3e2cfe75ff941a6
7
- data.tar.gz: 93db87869c4f8d9b8c0e019a0e6c9bdd201d30a6b1edae8a0f1b1c3a68beeaa3fe1940435fbefb78cb521b2364b9955492657fb0f3f93278253e60232bb2c833
6
+ metadata.gz: e63cf230c1b23a6e75b2c4aeb7806bb0d4f6627cbf8b3bc72940f858f0f9f8328ca40227c4e0983664bb54989280a8043bd7c616456640d2dab0e7ff86d83cbb
7
+ data.tar.gz: bcab893dac34848a1da83809417ce24974f73ad629fe121016d8b18d3e76d94e3f72a7172e9ceead74bccda95dc68019596dca9a05de37be97c2c7d8fd4244df
@@ -31,8 +31,7 @@ module Jekyll
31
31
  result = []
32
32
 
33
33
  context.stack do
34
- url = get_url_from_assigned_value(context) ||
35
- get_url_from_page_attributes(context) ||
34
+ url = get_dereferenced_url(context) ||
36
35
  @url
37
36
 
38
37
  raise "No URL provided or in innapropriate form '#{url}'" unless is_valid_url?(url)
@@ -79,6 +78,8 @@ module Jekyll
79
78
  value.force_encoding("UTF-8")
80
79
  when Date, Icalendar::Values::DateTime
81
80
  value.to_time
81
+ when Icalendar::Values::Uri
82
+ value.to_s
82
83
  else
83
84
  value
84
85
  end
@@ -115,19 +116,10 @@ module Jekyll
115
116
  !!(url =~ URI::regexp)
116
117
  end
117
118
 
118
- def get_url_from_page_attributes(context)
119
- # Dereference url from something like "page.calender_url" to the page's calendar_url
120
- dig_attrs = @url.split(".")
121
- dig_attrs[0] = dig_attrs[0].to_sym if dig_attrs[0].present?
119
+ def get_dereferenced_url(context)
120
+ return unless context.key?(@url)
122
121
 
123
- context.registers.dig(*dig_attrs) # will return result or nil (if not found)
124
- end
125
-
126
- def get_url_from_assigned_value(context)
127
- return unless scope = context.scopes.find { |scope| scope[@url] }
128
-
129
- # Dereference the URL if we were passed a variable name.
130
- scope[@url]
122
+ context[@url]
131
123
  end
132
124
 
133
125
  def scan_attributes!
@@ -35,7 +35,7 @@ module Jekyll
35
35
  @simple_html_description ||= begin
36
36
  description&.clone.tap do |d|
37
37
  description_urls.each do |url|
38
- d.gsub! url, %(<a href='#{url}'>#{url}</a>)
38
+ d.force_encoding("UTF-8").gsub! url, %(<a href='#{url}'>#{url}</a>)
39
39
  end
40
40
  end
41
41
  end
@@ -46,7 +46,7 @@ module Jekyll
46
46
  end
47
47
 
48
48
  def description_urls
49
- @description_urls ||= description.to_s.scan(URL_REGEX).to_a
49
+ @description_urls ||= description.to_s.force_encoding("UTF-8").scan(URL_REGEX).to_a
50
50
  end
51
51
 
52
52
  private
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  class IcalTag < Liquid::Block
5
- VERSION = "1.1.0"
5
+ VERSION = "1.2.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-ical-tag
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ricky Chilcott
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-04-08 00:00:00.000000000 Z
11
+ date: 2020-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll