jekyll-uj-powertools 1.0.8 → 1.0.10

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: da3ce92d92bcdf7f5ed7ec8063a02884b6aa3112bc4d5df11abf0c0ca401be10
4
- data.tar.gz: e04d89bc278e37e8b5ae65c9ee8aeba0787376cb9c6a797daf666e498f52dd68
3
+ metadata.gz: 5242adfc2a8be4ae1dfb522cae775c80d7ffe351593e890d3acfa1986d9b2cd4
4
+ data.tar.gz: 46b790d41d3027500e34dd3268e7c0c69e2516b841c6e1fd9b9342b15aa2cdf4
5
5
  SHA512:
6
- metadata.gz: f85fe31a2ad07dbf2f40674810095f419f36f58055abb8866c784c6e91cbb24dd3a10b34cb0df614b31b442dac6c8289ac8dfebf8840faa773a88a9a19a70651
7
- data.tar.gz: a699ccfc61bbfca668f897ec48cf89ff787abf928ec103d9cfbc48d514b47a8fa059157c0c4952e766215ac7e03b7fb46ef1764ceff89ab415fa67139c3b8387
6
+ metadata.gz: d7df5f81678360ae4d33e33cd5fbd5e3e0544e193a7d18732f6399294345bc0f644bdd237e956f3ff14cb113a13527e6d09c72169e1565931532688d06c212c2
7
+ data.tar.gz: e391beb804e5d8ca715dbb221f5fc4705f2d8d2a141ad5fbcb414dede1de6efbf4fe45aa6ad2592b358418b6ed275ad04711c717123dcc6ec218f080ce63faa9
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module UJPowertools
3
- VERSION = "1.0.8"
3
+ VERSION = "1.0.10"
4
4
  end
5
5
  end
@@ -4,12 +4,26 @@ module Jekyll
4
4
  module UJPowertools
5
5
  # Strip ads from the input
6
6
  def uj_strip_ads(input)
7
- input.gsub(/\s*<ad-unit>[\s\S]*?<\/ad-unit>\s*/m, '')
7
+ input
8
+ # Remove HTML <ad-units>
9
+ .gsub(/\s*<ad-unit>[\s\S]*?<\/ad-unit>\s*/m, '')
10
+ # Remove includes starting with "/master/modules/adunits/"
11
+ .gsub(/\s*\{% include \/master\/modules\/adunits\/.*? %\}\s*/m, '')
8
12
  end
9
13
 
10
14
  # Escape a string for use in JSON
15
+ # def uj_json_escape(value)
16
+ # value
17
+ # .gsub('\\', '\\\\') # Escape backslashes
18
+ # .gsub('"', '\"') # Escape double quotes
19
+ # .gsub("\b", '\\b') # Escape backspace
20
+ # .gsub("\f", '\\f') # Escape formfeed
21
+ # .gsub("\n", '\\n') # Escape newline
22
+ # .gsub("\r", '\\r') # Escape carriage return
23
+ # .gsub("\t", '\\t') # Escape tab
24
+ # end
11
25
  def uj_json_escape(value)
12
- value.gsub('\\', '\\\\').gsub('"', '\"')
26
+ value.to_json[1..-2] # Convert to JSON and remove the surrounding quotes
13
27
  end
14
28
 
15
29
  # Increment a global counter that can be accessed from any page then return the new value
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-uj-powertools
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - ITW Creative Works
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-29 00:00:00.000000000 Z
11
+ date: 2024-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll