jekyll-ical-tag 1.0.6 → 1.0.7

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: 6e385d8a81d0b523aeb371af1c615c437ab4ecd48f0d8fa439a4d9a1fffb52c9
4
- data.tar.gz: d980f24aab04883f6b646b5b243c12b9b1959f2a27e8f15d65e70cc75dd1f1d1
3
+ metadata.gz: bd1beec28fa33ea701a64a6ef052b8c5fe215254f8ee5a7132a859156d395205
4
+ data.tar.gz: d2f145cfdf30bb6e15be692eba8541fa0a030e5770b9acad53d037405e088c16
5
5
  SHA512:
6
- metadata.gz: 516c30e7d39e76ba2f291ab57c2923c75fb6fe1ee2bca375067a93586f9f8c3b731263e60eced68af14b1492b891655dd46ad4c12c2e6eb213cff3183f9aac07
7
- data.tar.gz: 07221fa1caaf5501a32000892b0ff27d55272900c04461add22baa9107c5dca3347ee2dcbd7204016c68b8b4caa8ff6ed3a596cdf604a1a8e0c68c5c47cce544
6
+ metadata.gz: 462302c862fedbc0dddac6fb4b21cccaf385ee7407ed3feda606e425c95682b5cd2b1585df02b01d71575dd0882cc0a0c2018fa83522de7dc4393f034b9e5d7e
7
+ data.tar.gz: a307c6fcd3de6ac28ce920d54714646213cec7ed39c31590586f17e634bd5fc1c0bcab2943d6e6fc029844379fabf6a5351d13285f9a4e0997fe86a8997c85b5
data/Gemfile.lock CHANGED
@@ -55,7 +55,7 @@ GEM
55
55
  method_source (0.9.0)
56
56
  mini_portile2 (2.4.0)
57
57
  minitest (5.11.3)
58
- nokogiri (1.10.4)
58
+ nokogiri (1.10.8)
59
59
  mini_portile2 (~> 2.4.0)
60
60
  pathutil (0.16.2)
61
61
  forwardable-extended (~> 2.6)
data/README.md CHANGED
@@ -8,7 +8,7 @@ Description: Pull ICS feed and provide a for-like loop of calendar events
8
8
 
9
9
  To your Gemfile:
10
10
 
11
- `gem 'jekyll-ical-tag', git: "https://github.com/Rakefire/jekyll-ical-tag.git"`
11
+ `gem 'jekyll-ical-tag'`
12
12
 
13
13
  To your `_config.yml`
14
14
 
@@ -50,3 +50,7 @@ plugins:
50
50
  - `end_time` - end time of event
51
51
  - `url` - url of event, if provided, if not, take the first url from the description.
52
52
  - `attendees` - [Array] of attendees names/emails
53
+
54
+ # Special Thanks
55
+
56
+ Special thanks to the following contributors: @marchehab98 @meitar
@@ -17,12 +17,12 @@ module Jekyll
17
17
 
18
18
  def simple_html_description
19
19
  @simple_html_description ||= begin
20
- description&.clone.tap do |d|
21
- description_urls.each do |url|
22
- d.force_encoding("UTF-8").gsub! url, %(<a href='#{url}'>#{url}</a>)
20
+ description&.clone.tap do |d|
21
+ description_urls.each do |url|
22
+ d.gsub! url, %(<a href='#{url}'>#{url}</a>)
23
+ end
23
24
  end
24
25
  end
25
- end
26
26
  end
27
27
 
28
28
  def attendees
@@ -30,7 +30,7 @@ module Jekyll
30
30
  end
31
31
 
32
32
  def description_urls
33
- @description_urls ||= description.to_s.force_encoding("UTF-8").scan(URL_REGEX).to_a
33
+ @description_urls ||= description.to_s.scan(URL_REGEX).to_a
34
34
  end
35
35
 
36
36
  private
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  class IcalTag < Liquid::Block
5
- VERSION = "1.0.6"
5
+ VERSION = "1.0.7"
6
6
  end
7
7
  end
@@ -44,11 +44,11 @@ module Jekyll
44
44
  context["event"] = {
45
45
  "index" => index,
46
46
  "uid" => event.uid.presence,
47
- "summary" => event.summary.presence,
48
- "description" => event.description.presence,
49
- "simple_html_description" => event.simple_html_description.presence,
50
- "location" => event.location.presence,
51
- "url" => event.url&.to_s.presence || event.description_urls.first,
47
+ "summary" => as_utf8(event.summary).presence,
48
+ "description" => as_utf8(event.description).presence,
49
+ "simple_html_description" => as_utf8(event.simple_html_description).presence,
50
+ "location" => as_utf8(event.location).presence,
51
+ "url" => as_utf8(event.url&.to_s.presence || event.description_urls.first).presence,
52
52
  "start_time" => event.dtstart&.to_time.presence,
53
53
  "end_time" => event.dtend&.to_time.presence,
54
54
  "attendees" => event.attendees,
@@ -80,6 +80,12 @@ module Jekyll
80
80
 
81
81
  private
82
82
 
83
+ def as_utf8(str)
84
+ return unless str
85
+
86
+ str.force_encoding("UTF-8")
87
+ end
88
+
83
89
  def scan_attributes!
84
90
  @attributes = {}
85
91
  @markup.scan(Liquid::TagAttributes) do |key, value|
@@ -101,8 +107,7 @@ module Jekyll
101
107
  only_past = @attributes["only_past"] == "true"
102
108
 
103
109
  raise "Set only_future OR only_past, not both" if only_future && only_past
104
- @only =
105
- case
110
+ @only = case
106
111
  when only_future
107
112
  :future
108
113
  when only_past
@@ -113,8 +118,7 @@ module Jekyll
113
118
  end
114
119
 
115
120
  def set_before_date!
116
- @before_date =
117
- begin
121
+ @before_date = begin
118
122
  if @attributes["before_date"]
119
123
  Time.parse(@attributes["before_date"])
120
124
  end
@@ -124,8 +128,7 @@ module Jekyll
124
128
  end
125
129
 
126
130
  def set_after_date!
127
- @after_date =
128
- begin
131
+ @after_date = begin
129
132
  if @attributes["after_date"]
130
133
  Time.parse(@attributes["after_date"])
131
134
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-ical-tag
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ricky Chilcott