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 +4 -4
- data/lib/jekyll-ical-tag.rb +6 -14
- data/lib/jekyll-ical-tag/event.rb +2 -2
- data/lib/jekyll-ical-tag/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3390276b35fd0dd3b56ad571b8f780d2a34392d9bc2bf96e8598bc60a6ee2b8
|
4
|
+
data.tar.gz: 419bf7845e4bf1eafee30201c2a601676511b1938b5e4f277af6197eef7c7c80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e63cf230c1b23a6e75b2c4aeb7806bb0d4f6627cbf8b3bc72940f858f0f9f8328ca40227c4e0983664bb54989280a8043bd7c616456640d2dab0e7ff86d83cbb
|
7
|
+
data.tar.gz: bcab893dac34848a1da83809417ce24974f73ad629fe121016d8b18d3e76d94e3f72a7172e9ceead74bccda95dc68019596dca9a05de37be97c2c7d8fd4244df
|
data/lib/jekyll-ical-tag.rb
CHANGED
@@ -31,8 +31,7 @@ module Jekyll
|
|
31
31
|
result = []
|
32
32
|
|
33
33
|
context.stack do
|
34
|
-
url =
|
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
|
119
|
-
|
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
|
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
|
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.
|
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-
|
11
|
+
date: 2020-04-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|