jekyll-typogrify 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: adc86d464ffe5ba4aa8e6488b75dd88a40eb1a6b
4
- data.tar.gz: 92567898604f6bef389a3df613966f88353f39d6
3
+ metadata.gz: 62bd1b16f15457a95951366634b2946c6b5662ac
4
+ data.tar.gz: 84b331316ac1516ce9db76fcdb71bf10a0932be5
5
5
  SHA512:
6
- metadata.gz: 6a2b56115bebc4c8fdb271d6f0ef6c4cb6c8349fbe58f538dbd09efd3fa9b7ae146ec9895da681cf11555f457aebee163c50b2f49292b047f73b2e0b943ed787
7
- data.tar.gz: 24bb2593043c63c5de622eb52ec0d161f365446da3cd21e802bbd884e6ca5742491b2edc70b2f05087a3ae2710c92193745230380f6e58171fbc06bed70fe9cf
6
+ metadata.gz: d4a8193178720204c4380ffa156f5e93f6c453dd18e90dc8c16f899a7678ffb1530a8d46dd433abad1f14ffae906c3d160446a473c1c759c18b8ed7713b48754
7
+ data.tar.gz: 0a3c6542d7ea64248487266b31056f453e6d734a235e03038a6f6ca49a32a7bcf8d788485fb7f2aeb5bdb3dc60685984ac16dac8e1aa28bd7258370ccb6fbd34
data/.travis.yml CHANGED
@@ -1,8 +1,8 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.0
4
- - 2.1
5
3
  - 2.2
4
+ - 2.3
5
+ - 2.4
6
6
  before_install:
7
7
  - gem update bundler
8
8
  script:
@@ -12,4 +12,4 @@ after_script:
12
12
  after_success:
13
13
  - gem install package_cloud
14
14
  - bundle exec rake build
15
- - package_cloud push myles/jekyll-typogrify pkg/jekyll-typogrify-0.3.3.gem
15
+ - package_cloud push myles/jekyll-typogrify pkg/jekyll-typogrify-0.3.4.gem
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jekyll-typogrify (0.3.3)
4
+ jekyll-typogrify (0.3.4)
5
5
  titlecase
6
6
  typogruby
7
7
 
@@ -103,4 +103,4 @@ DEPENDENCIES
103
103
  typogruby
104
104
 
105
105
  BUNDLED WITH
106
- 1.16.0
106
+ 1.16.2
data/README.md CHANGED
@@ -138,6 +138,16 @@ Let's make sure click doesn't look like dick.
138
138
  <p>There’s more to love with every <span class="fix-letter-spacing">click</p>.</p>
139
139
  ```
140
140
 
141
+ ### Em dash
142
+
143
+ Identify em dashes and surround them with a span.
144
+
145
+ ```html
146
+ <p>{{ "Upon discovering the errors—all 124 of them—the publisher immediately recalled the books." | jt_emdash }}</p>
147
+
148
+ <p>Upon discovering the errors<span class="emdash">&mdash;</span>all 124 of them<span class="emdash">&mdash;</span>the publisher immediately recalled the books.</p>
149
+ ```
150
+
141
151
  ## Development
142
152
 
143
153
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
data/appveyor.yml CHANGED
@@ -1,13 +1,13 @@
1
- version: v0.3.3-{branch}-{build}
1
+ version: v0.3.4-{branch}-{build}
2
2
 
3
3
  environment:
4
4
  matrix:
5
5
  - ruby_version: 22
6
6
  - ruby_version: 22-x64
7
- - ruby_version: 21
8
- - ruby_version: 21-x64
9
- - ruby_version: 200
10
- - ruby_version: 200-x64
7
+ - ruby_version: 23
8
+ - ruby_version: 23-x64
9
+ - ruby_version: 24
10
+ - ruby_version: 24-x64
11
11
 
12
12
  install:
13
13
  - set PATH=C:\Ruby%ruby_version%\bin;%PATH%
@@ -103,6 +103,15 @@ module Jekyll
103
103
  return custom_caps(text.to_s)
104
104
  end
105
105
 
106
+ # converts a — (em dash) by optional whitespace or a non-breaking space
107
+ # to the HTML entity and surrounds it in a span with a styled class.
108
+ #
109
+ # @param [String] text input text
110
+ # @return [String] input text with em dashes wrapped
111
+ def jt_emdash(text)
112
+ return emdash(text.to_s)
113
+ end
114
+
106
115
  private
107
116
 
108
117
  # custom modules to jekyll-typogrify
@@ -133,6 +142,17 @@ module Jekyll
133
142
  end
134
143
  end
135
144
  end
145
+
146
+ # converts a — (em dash) by optional whitespace or a non-breaking space
147
+ # to the HTML entity and surrounds it in a span with a styled class.
148
+ #
149
+ # @param [String] text input text
150
+ # @return [String] input text with em dashes wrapped
151
+ def emdash(text)
152
+ text.gsub(/(\s|&nbsp;)—(?:mdash;|#8212;)?(\s|&nbsp;)/) { |str|
153
+ $1 + '<span class="emdash">&mdash;</span>' + $2
154
+ }.gsub(/(\w+)="(.*?)<span class="emdash">&mdash;<\/span>(.*?)"/, '\1="\2&mdash;\3"')
155
+ end
136
156
  end
137
157
  end
138
158
 
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Typogrify
3
- VERSION = "0.3.3"
3
+ VERSION = "0.3.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-typogrify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Myles Braithwaite
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-17 00:00:00.000000000 Z
11
+ date: 2018-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typogruby