jemoji 0.6.1 → 0.6.2
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 +10 -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: 663ba1344d48de42b117da24d79b0e704fdf101b
|
4
|
+
data.tar.gz: 1449d59da2f9d1118d5ba371f3f21f56335f1ca6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f26f33f454aa288847d00f52117fafc08bd53707cd9af7bb182805b8af6a69fd9f8d556d7f0038606189d62cad8881c53d42f312a264de7c524e5aac6311e5ef
|
7
|
+
data.tar.gz: 4f76cade7b1f987455ecfee964ec92223348b07472d2b90d29c6e6904d48e5f88803b534abf95f7ead21e0882a5639ed8927d43fd3a657b5f09b0292eb646f78
|
data/lib/jemoji.rb
CHANGED
@@ -5,11 +5,20 @@ require 'html/pipeline'
|
|
5
5
|
module Jekyll
|
6
6
|
class Emoji
|
7
7
|
GITHUB_DOT_COM_ASSET_ROOT = "https://assets.github.com/images/icons/".freeze
|
8
|
+
BODY_START_TAG = "<body".freeze
|
8
9
|
|
9
10
|
class << self
|
10
11
|
def emojify(doc)
|
12
|
+
return unless doc.output =~ HTML::Pipeline::EmojiFilter.emoji_pattern
|
11
13
|
src = emoji_src(doc.site.config)
|
12
|
-
|
14
|
+
if doc.output.include? BODY_START_TAG
|
15
|
+
parsed_doc = Nokogiri::HTML::Document.parse(doc.output)
|
16
|
+
body = parsed_doc.at_css('body')
|
17
|
+
body.children = filter_with_emoji(src).call(body.inner_html)[:output].to_s
|
18
|
+
doc.output = parsed_doc.to_html
|
19
|
+
else
|
20
|
+
doc.output = filter_with_emoji(src).call(doc.output)[:output].to_s
|
21
|
+
end
|
13
22
|
end
|
14
23
|
|
15
24
|
# Public: Create or fetch the filter for the given {{src}} asset root.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jemoji
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitHub, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|