jemoji 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jemoji.rb +4 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f3d0dbf1ee5c96ae67ab8a94896e7e9744073713
|
4
|
+
data.tar.gz: 08bb97a063306db98db09c281c010bbc3f7cfdf2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de2051fa5df9e251b45eeea9a8c3845f392f156b67ac9f746753672026090921d0f6b43e65cb6d1acf851492975576bd8904e4887598628b95d664e549931e2b
|
7
|
+
data.tar.gz: ba45a8ac1153c1c57eb8a47a5d1326368c51df6237bc61a43bd998a11ed4698bb0e2556a2e8089250dc6355972858601edd46b432ea6833695d60ab59298fffd
|
data/lib/jemoji.rb
CHANGED
@@ -8,7 +8,7 @@ module Jekyll
|
|
8
8
|
if @site.config.key?("emoji") && @site.config["emoji"].key?("src")
|
9
9
|
@site.config["emoji"]["src"]
|
10
10
|
else
|
11
|
-
"https://github.global.ssl.fastly.net/images/icons/emoji
|
11
|
+
"https://github.global.ssl.fastly.net/images/icons/emoji"
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
@@ -17,7 +17,7 @@ module Jekyll
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def regex
|
20
|
-
@
|
20
|
+
@regex ||=
|
21
21
|
begin
|
22
22
|
emoji_escaped = emoji.map { |emoji| Regexp.escape(emoji) }
|
23
23
|
Regexp.new ":(#{emoji_escaped.join("|")}):"
|
@@ -31,11 +31,11 @@ module Jekyll
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def emojify(page)
|
34
|
-
page.content.gsub!(regex) {
|
34
|
+
page.content.gsub!(regex) { img($1) }
|
35
35
|
end
|
36
36
|
|
37
37
|
def img(name)
|
38
|
-
"<img src=\"#{src}/#{name}.png\" alt=\"#{name}\" class=\"emoji\"/>"
|
38
|
+
"<img src=\"#{src}/#{name}.png\" alt=\"#{name}\" class=\"emoji\" height=\"20\" />"
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|