rubypants-unicode 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rubypants-unicode/rubypants-unicode.rb +3 -3
- data/lib/rubypants-unicode/version.rb +1 -1
- data/test/test_rubypants.rb +9 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec48527b8700c02e1f3ac369ef7556f671ad4096
|
4
|
+
data.tar.gz: 048ed99ea4e2cfcfae7a83c6eb7072ba508abcfb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a751af1c068cd70911270f0253463b929ac4748a42d1e3060855829993b383776f73a82fccfe8b593a80b58cb96469c54b2223a1baa205c65e8bf1bff92fabc9
|
7
|
+
data.tar.gz: 2f0a2329c360de3131072083da6b4eb71e2b79f10dd91cd6dd48edf13e44bf867be55818145f549b90c13fc072da805b7d7162f19880871765e33cf6afa21488
|
@@ -345,7 +345,7 @@ class RubyPants < String
|
|
345
345
|
# em-dash HTML entity.
|
346
346
|
#
|
347
347
|
def educate_dashes(str)
|
348
|
-
str.gsub(
|
348
|
+
str.gsub(/--(?!>)/, '—')
|
349
349
|
end
|
350
350
|
|
351
351
|
# The string, with each instance of "<tt>--</tt>" translated to an
|
@@ -353,7 +353,7 @@ class RubyPants < String
|
|
353
353
|
# em-dash HTML entity.
|
354
354
|
#
|
355
355
|
def educate_dashes_oldschool(str)
|
356
|
-
str.gsub(/---/, '—').gsub(
|
356
|
+
str.gsub(/---/, '—').gsub(/--(?!>)/, '–')
|
357
357
|
end
|
358
358
|
|
359
359
|
# Return the string, with each instance of "<tt>--</tt>" translated
|
@@ -367,7 +367,7 @@ class RubyPants < String
|
|
367
367
|
# Aaron Swartz for the idea.)
|
368
368
|
#
|
369
369
|
def educate_dashes_inverted(str)
|
370
|
-
str.gsub(/---/, '–').gsub(
|
370
|
+
str.gsub(/---/, '–').gsub(/--(?!>)/, '—')
|
371
371
|
end
|
372
372
|
|
373
373
|
# Return the string, with each instance of "<tt>...</tt>" translated
|
data/test/test_rubypants.rb
CHANGED
@@ -158,4 +158,13 @@ EOF
|
|
158
158
|
assert_rp_equal %q{foo\*bar}, "foo\\*bar"
|
159
159
|
assert_rp_equal %q{foo\&bar}, "foo\\&bar"
|
160
160
|
end
|
161
|
+
|
162
|
+
def test_html_comments
|
163
|
+
|
164
|
+
assert_rp_equal "-->", "-->"
|
165
|
+
assert_rp_equal "-->", "-->", [:oldschool]
|
166
|
+
assert_rp_equal "-->", "-->", [:inverted]
|
167
|
+
|
168
|
+
end
|
169
|
+
|
161
170
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubypants-unicode
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Gruber
|
@@ -9,6 +9,7 @@ authors:
|
|
9
9
|
- Christian Neukirchen
|
10
10
|
- Jeremy McNevin
|
11
11
|
- Chris Chapman
|
12
|
+
- Jared White
|
12
13
|
autorequire:
|
13
14
|
bindir: bin
|
14
15
|
cert_chain: []
|