jekyll-uj-powertools 1.0.5 → 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: afb849d2453f8d1e7053f9ebe87b1bcfb5f65086c77bf9ac390f19824bca1901
4
- data.tar.gz: 49f36fcb3a20ae9aff0f9593ffeaf837e3f054dbb8ced9ea8e5f5a8dcc7efd5b
3
+ metadata.gz: 9db7ef2a5b59ca20237faf78d7b55ad7efa383dd792420383fe5dac7b6f043e4
4
+ data.tar.gz: 66d40c4551b9a0f65b9a95bdf6a193e3383c9ae8c128db0f2a04f41cf659e966
5
5
  SHA512:
6
- metadata.gz: 3fefc884dec9d07873b9d4b76bcd993e94fd0ec5dff18f0986e3159ed400ee0c6389ab385e0a787427fc48b33ba41756d8d5d1d2487566cc3eff9bfebc47854f
7
- data.tar.gz: ac05a9fe8effd523d3910a0f501cbc44ff4ddb31fdbcec3e9bbf8d0fa90e33ae9889bfcbd7d13d34f7a5936de2f97bff80fb7fac49f79cafa853a01e4d5eca46
6
+ metadata.gz: 138078fa39a755f3cc5aae6360106dea7ecbe09f202469d7b805ccc0115944f2d953783252695d5593df8a3f528f47a26d4dbc6c3b52c4854b7e5e50be813dd1
7
+ data.tar.gz: 71a73c6f9d3281e3d8dfecf458e31f34935e1b337fa3e23c91865f2d4658e5c4a27cd54ff0b86ea7c756f16ec37db0a7e790d06c358b05736ba1bd8eef0dc9e9
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module UJPowertools
3
- VERSION = "1.0.5"
3
+ VERSION = "1.0.7"
4
4
  end
5
5
  end
@@ -3,7 +3,8 @@ require "jekyll"
3
3
  module Jekyll
4
4
  module UJPowertools
5
5
  def strip_ads(input)
6
- input.gsub(/<ad-unit>[\s\S]*?<\/ad-unit>/m, '')
6
+ # input.gsub(/<ad-unit>[\s\S]*?<\/ad-unit>/m, '')
7
+ input.gsub(/\s*<ad-unit>[\s\S]*?<\/ad-unit>\s*/m, '')
7
8
  end
8
9
 
9
10
  def json_escape(value)
@@ -9,19 +9,20 @@ RSpec.describe Jekyll::UJPowertools do
9
9
  let(:dummy) { DummyClass.new }
10
10
 
11
11
  describe '.strip_ads' do
12
- # it 'removes ads from the string' do
13
- # expect(dummy.strip_ads('{% include /master/modules/adunits/adsense-in-article.html index="0" %} This is content')).to eq(' This is content')
14
- # end
15
-
16
- # it 'returns the original string if no ads are present' do
17
- # expect(dummy.strip_ads('No ads here')).to eq('No ads here')
18
- # end
19
- it 'removes ads from the string' do
20
- expect(dummy.remove_ads('This is <!-- ADUNIT_TRIGGER_START -->and ad<!-- ADUNIT_TRIGGER_END -->')).to eq('This is ')
12
+ it 'removes ads from the string with custom HTML elements' do
13
+ expect(dummy.strip_ads('This is <ad-unit>and ad</ad-unit>')).to eq('This is ')
21
14
  end
22
15
 
23
16
  it 'returns the original string if no ads are present' do
24
- expect(dummy.remove_ads('No ads here')).to eq('No ads here')
17
+ expect(dummy.strip_ads('No ads here')).to eq('No ads here')
18
+ end
19
+
20
+ it 'removes multiple ads from the string' do
21
+ expect(dummy.strip_ads('First part<ad-unit>ad content</ad-unit>Second part<ad-unit>more ad content</ad-unit>Third part')).to eq('First partSecond partThird part')
22
+ end
23
+
24
+ it 'removes surrounding whitespace' do
25
+ expect(dummy.strip_ads("Start\n<ad-unit>\n ad content\n</ad-unit>\nEnd")).to eq("Start\nEnd")
25
26
  end
26
27
  end
27
28
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-uj-powertools
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - ITW Creative Works