add_to_calendar_links 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/add_to_calendar_links.rb +5 -5
- data/lib/add_to_calendar_links/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d92f7b9879a385554bafb57afd02b577d7a3ba10b81484534665b4137400cf3
|
4
|
+
data.tar.gz: ae2db556c46a88256cf808aa56cef2d059f253aa3442183a42b38c10c946720c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aaa19f86a27033729e856b955adee991d612d3dcde7f6830b8a8235db80608c9e57676f5876c6c0d6a60dc1c3abb767879a1eb24796d1ac54743966ad313f6b4
|
7
|
+
data.tar.gz: 1f4a135357d2b5a34dd1094031dd524723fd1a247b359b6f4c1606ef780bef5f97ae382802e26701816d0ad733afecebc0e5387754755d585f1aea0fb6b72490
|
@@ -7,7 +7,7 @@ include ERB::Util
|
|
7
7
|
require 'tzinfo'
|
8
8
|
require 'date'
|
9
9
|
require 'uri'
|
10
|
-
|
10
|
+
require 'byebug'
|
11
11
|
|
12
12
|
module AddToCalendarLinks
|
13
13
|
class Error < StandardError; end
|
@@ -258,12 +258,12 @@ module AddToCalendarLinks
|
|
258
258
|
if strip_html
|
259
259
|
string.gsub!("<br>", "\n")
|
260
260
|
string.gsub!("<p>", "\n")
|
261
|
-
string.gsub!("</p>", "\n")
|
261
|
+
string.gsub!("</p>", "\n\n")
|
262
|
+
string.gsub!("&", "and")
|
263
|
+
string.gsub!(" ", " ")
|
262
264
|
string = strip_html_tags(string)
|
263
265
|
end
|
264
266
|
string.gsub!("\\", "\\\\\\") # \ >> \\ --yes, really: https://stackoverflow.com/questions/6209480/how-to-replace-backslash-with-double-backslash
|
265
|
-
string.gsub!(",", "\\,")
|
266
|
-
string.gsub!(";", "\\;")
|
267
267
|
string.gsub!("\r\n", "\n") # so can handle all newlines the same
|
268
268
|
string.split("\n").map { |e|
|
269
269
|
if e.empty?
|
@@ -271,7 +271,7 @@ module AddToCalendarLinks
|
|
271
271
|
else
|
272
272
|
url_encode(e)
|
273
273
|
end
|
274
|
-
}.join("
|
274
|
+
}.join("\n")
|
275
275
|
end
|
276
276
|
|
277
277
|
def strip_html_tags(description)
|