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 +4 -4
- data/.travis.yml +3 -3
- data/Gemfile.lock +2 -2
- data/README.md +10 -0
- data/appveyor.yml +5 -5
- data/lib/jekyll/typogrify.rb +20 -0
- data/lib/jekyll/typogrify/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62bd1b16f15457a95951366634b2946c6b5662ac
|
4
|
+
data.tar.gz: 84b331316ac1516ce9db76fcdb71bf10a0932be5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
15
|
+
- package_cloud push myles/jekyll-typogrify pkg/jekyll-typogrify-0.3.4.gem
|
data/Gemfile.lock
CHANGED
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">—</span>all 124 of them<span class="emdash">—</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.
|
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:
|
8
|
-
- ruby_version:
|
9
|
-
- ruby_version:
|
10
|
-
- ruby_version:
|
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%
|
data/lib/jekyll/typogrify.rb
CHANGED
@@ -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| )—(?:mdash;|#8212;)?(\s| )/) { |str|
|
153
|
+
$1 + '<span class="emdash">—</span>' + $2
|
154
|
+
}.gsub(/(\w+)="(.*?)<span class="emdash">—<\/span>(.*?)"/, '\1="\2—\3"')
|
155
|
+
end
|
136
156
|
end
|
137
157
|
end
|
138
158
|
|
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.
|
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-
|
11
|
+
date: 2018-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typogruby
|