jekyll-wns 4.2.0 → 4.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a995d602d32dc995ad7d09baa3b5419873e39612b021d34a20ad2fc07640d769
4
- data.tar.gz: 356c4ebd2d6f7d3507cc26d74821c6206e5a86be29f882a935b1c9a4e2364706
3
+ metadata.gz: 7b8350877bd321d5dfac3f0dccfa0948b465c4e6da9bbab5940ac7632b78f276
4
+ data.tar.gz: 4c6b98b9e49be9ef52676690a3d852267f5f399780b2e11fa3d91324418cccb5
5
5
  SHA512:
6
- metadata.gz: ab9537e8acee7d592a8e8925fb6595e5a21cccdb93964049aa6ec0d10f4c4b6d398499d16502551fb0f157367ac741bf1045c45af3d049967431c8d4c894eafb
7
- data.tar.gz: 17fe36761fb33158dd621375072e88a01e9247dd6513a6897f506f6fce3ac9e5c3b44bd636fa0b57a81e95f2a607da359865e9d30e8e075917e427a2014e74bc
6
+ metadata.gz: 1ca1721d9cba746a21c27d2cd7a5c3ba838174895a8f395379f56997e66e540652032deae64a0e23ed4ab428c165e8ee5af88a41d69d551da256d4bab3e3a702
7
+ data.tar.gz: 9f3d4c16938369be6fcbb8166c5563b1d846862cb43a4168e57acbe5c159d2b5a89966a44949ccfbb29fd691aa6fd4da645a29a33621a697b29ff4ec39cc2bdf
data/jekyll-wns.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "jekyll-wns"
5
- spec.version = "4.2.0"
5
+ spec.version = "4.2.3"
6
6
  spec.authors = ["Thai Chung"]
7
7
  spec.email = ["mail@0xReki.de"]
8
8
  spec.summary = "Collection of Filters, Tags and Hooks I use."
@@ -7,12 +7,12 @@ module WNS
7
7
  labels.length > 0
8
8
  end
9
9
 
10
- def self.label_unicode!(doc)
11
- if LabelUnicode::enabled?(doc)
10
+ def self.label_pronounciation!(doc)
11
+ if LabelPronounciation::enabled?(doc)
12
12
  wns = doc.site.config["wns"] || {}
13
13
  labels = wns["label_pronounciation"] || false
14
14
  for i in (0..(labels.length()) - 1) do
15
- doc.content = doc.content.gsub(Regexp.new("\b#{labels[i].term}\b"), "<span aria-label='#{labels[i].pronounciation}'>\\1</span>")
15
+ doc.content = doc.content.gsub(Regexp.new("\b(#{labels[i]["term"]})\b"), "<span aria-label='#{labels[i]["pronounciation"]}'>\\1</span>")
16
16
  end
17
17
  end
18
18
  end
@@ -11,7 +11,7 @@ module WNS
11
11
  def self.label_unicode!(doc)
12
12
  if LabelUnicode::enabled?(doc)
13
13
  for i in (0..(LabelUnicode::SYMBOLS.length()) - 1) do
14
- doc.content = doc.content.gsub(Regexp.new("([\\-A-Za-z0-9]*|)#{LabelUnicode::SYMBOLS[i].source}([\\-A-Za-z0-9]*|)"), "<span aria-label='\\1#{LabelUnicode::READINGS[i]}\\3'>\\1\\2\\3</span>")
14
+ doc.content = doc.content.gsub(Regexp.new("(\\S*)#{LabelUnicode::SYMBOLS[i].source}(\\S*)"), "<span aria-label='\\1#{LabelUnicode::READINGS[i]}\\3'>\\1\\2\\3</span>")
15
15
  end
16
16
  end
17
17
  end
@@ -2,24 +2,23 @@ Jekyll::Hooks.register :pages, :pre_render do |document|
2
2
  if document.path =~ /(.md|.html)/
3
3
  WNS::Abbreviations::replace_abbreviations! document
4
4
  WNS::LabelUnicode::label_unicode! document
5
- WNS::LabelPronounciation::label_unicode! document
5
+ WNS::LabelPronounciation::label_pronounciation! document
6
6
  WNS::Quads::insert_quads_into_document! document
7
7
  end
8
8
  end
9
9
 
10
10
  Jekyll::Hooks.register :pages, :post_render do |document|
11
11
  if document.path =~ /(.md|.html)/
12
- true
12
+ WNS::LabelPronounciation::label_pronounciation document
13
13
  end
14
14
  end
15
15
 
16
16
  Jekyll::Hooks.register :posts, :pre_render do |document|
17
17
  WNS::Abbreviations::replace_abbreviations! document
18
18
  WNS::LabelUnicode::label_unicode! document
19
- WNS::LabelPronounciation::label_unicode! document
20
19
  WNS::Quads::insert_quads_into_document! document
21
20
  end
22
21
 
23
22
  Jekyll::Hooks.register :posts, :post_render do |document|
24
- true
23
+ WNS::LabelPronounciation::label_pronounciation document
25
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-wns
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.0
4
+ version: 4.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thai Chung