jekyll-emoji 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +33 -5
- data/jekyll-emoji.gemspec +13 -4
- data/lib/jekyll/emoji.rb +208 -175
- data/lib/jekyll/emoji/version.rb +1 -1
- data/tests/conversion_test.rb +42 -1
- metadata +38 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0de12d4ecb105bcf26e774bde5c75687cbee55a1
|
4
|
+
data.tar.gz: 23ea050f1423dedf1507d81750835f0203d274d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c890340261e610a52aa13b0fb8bbc9aa0a8c1718e0596ffc4baa301c25676027f67f7f9bbb3d576bbc33480cedd39da6663ba3ded9a43257c229e2d347344284
|
7
|
+
data.tar.gz: 03a6b8eecb4329048c01ecd4d749924aaeca19230963ca923c83185a6e2600bb29ebac0f77524796f125a448bc71d8e8d04b7868821640a9f17f990ef91dc771
|
data/README.md
CHANGED
@@ -21,7 +21,6 @@ Or install it yourself as:
|
|
21
21
|
Add the following configuration to your `_config.yml`:
|
22
22
|
|
23
23
|
~~~yaml
|
24
|
-
|
25
24
|
gems: ['jekyll-emoji']
|
26
25
|
emoji:
|
27
26
|
format: emojione-svg # default html
|
@@ -31,13 +30,21 @@ emoji:
|
|
31
30
|
|
32
31
|
The following formats are supported: `html`, `unicode`, `emojione-png`, and ` emojione-svg`.
|
33
32
|
|
34
|
-
For a
|
33
|
+
For a list of all available shortnames and asciimojis (I hope I coined this, so I can be cool) you can consult the [emoji.codes](http://emoji.codes), [Emoji One](http://emojione.com), and [Emoji Cheat Sheet](http://www.emoji-cheat-sheet.com/) websites.
|
34
|
+
|
35
|
+
Elements matching the following (CSS selector) will be excluded from the emojification:
|
36
|
+
|
37
|
+
~~~
|
38
|
+
[data-no-emoji], [data-no-emojis],
|
39
|
+
.no-emoji, .no-emojis, .no_emoji, .no_emojis,
|
40
|
+
code, pre
|
41
|
+
~~~
|
35
42
|
|
36
43
|
### Liquid filter
|
37
44
|
|
38
|
-
There's also a Liquid filter called `emojify
|
45
|
+
There's also a Liquid filter called `emojify`. It accepts three parameters: `format`, `ascii` and `shortname`. The former is a `String` (see above) while the latter two are `Boolean`.
|
39
46
|
|
40
|
-
```
|
47
|
+
```
|
41
48
|
{{ ":kissing_heart: :heart: :stuck_out_tongue:" | emojify }}
|
42
49
|
```
|
43
50
|
|
@@ -45,6 +52,28 @@ There's also a Liquid filter called `emojify` (not very original). It acceps thr
|
|
45
52
|
|
46
53
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
47
54
|
|
55
|
+
## Known Issues
|
56
|
+
|
57
|
+
### `emojify` filter performance
|
58
|
+
|
59
|
+
The `emojify` filter deteriorates performance *a little* under very *specific* conditions; it shouldn't be an issue, but in case you see performance degradation when generating the site—start with this.
|
60
|
+
|
61
|
+
### `emojify` filter unawareness
|
62
|
+
|
63
|
+
The `emojify` filter isn't aware of the context it's being called within.
|
64
|
+
|
65
|
+
~~~html
|
66
|
+
<span class=".no-emoji">{{ string_with_emoji | emojify }}</span>
|
67
|
+
~~~
|
68
|
+
|
69
|
+
The content of `string_with_emoji` would be emojified, provided that there's no HTML inside `string_with_emoji` which would match the above CSS path.
|
70
|
+
|
71
|
+
### HTML Entites inside blacklisted elements
|
72
|
+
|
73
|
+
When the `emojify` filter is used inside a markdown file (say, a blog post), and if `format: 'html'` is set, then the will convert all emoji-matching unicode codepoints—regardless of whether they're inside an element matching aforementioned blacklisting CSS selector—into HTML entities (using hex format `&#xhhhh;`).
|
74
|
+
|
75
|
+
This is due to the fact that HTML encoding is done in a post-processing step to simplify and speed up the implementation.
|
76
|
+
|
48
77
|
## Contributing
|
49
78
|
|
50
79
|
Bug reports and pull requests are welcome on GitHub at https://github.com/omninonsense/jekyll-emoji. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
|
@@ -53,4 +82,3 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/omnino
|
|
53
82
|
## License
|
54
83
|
|
55
84
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
56
|
-
|
data/jekyll-emoji.gemspec
CHANGED
@@ -9,16 +9,25 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Nino Miletich"]
|
10
10
|
spec.email = ["nino@miletich.me"]
|
11
11
|
|
12
|
+
spec.required_ruby_version = '>= 1.9', '~> 2.2'
|
13
|
+
|
12
14
|
spec.summary = %q{Adds support for emojis to Jekyll}
|
15
|
+
spec.description = %q{
|
16
|
+
A plug-n-play Jekyll plugin to enable emoji support in your site.
|
17
|
+
|
18
|
+
See documentation for more inforamtion on how to use it.
|
19
|
+
}
|
13
20
|
spec.homepage = "https://github.com/omninonsense/jekyll-emoji"
|
14
21
|
spec.license = "MIT"
|
15
22
|
|
16
23
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
17
24
|
spec.require_paths = ["lib"]
|
18
25
|
|
19
|
-
spec.
|
20
|
-
spec.
|
26
|
+
spec.add_development_dependency "bundler", "~> 1.10"
|
27
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
28
|
+
spec.add_development_dependency "minitest", "~> 5.8"
|
29
|
+
|
21
30
|
spec.add_dependency "jekyll", "~> 2.0"
|
22
|
-
spec.add_dependency "yajl-ruby"
|
23
|
-
spec.add_dependency "oga", "~> 1.2.0
|
31
|
+
spec.add_dependency "yajl-ruby", "~> 1.2", '>= 1.2.0'
|
32
|
+
spec.add_dependency "oga", "~> 1.2", '>= 1.2.0'
|
24
33
|
end
|
data/lib/jekyll/emoji.rb
CHANGED
@@ -3,210 +3,243 @@ require 'oga'
|
|
3
3
|
require 'yajl'
|
4
4
|
|
5
5
|
module Jekyll
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
formats = %w{
|
22
|
-
html
|
23
|
-
unicode
|
24
|
-
emojione-png
|
25
|
-
emojione-svg
|
6
|
+
module Emoji
|
7
|
+
class Converter < Converter
|
8
|
+
safe true
|
9
|
+
priority :lowest
|
10
|
+
|
11
|
+
Defaults = {
|
12
|
+
'format' => 'html',
|
13
|
+
'ascii' => false,
|
14
|
+
'shortname' => true
|
15
|
+
}.freeze
|
16
|
+
|
17
|
+
Attribute_blacklist = %w{
|
18
|
+
data-no-emoji
|
19
|
+
data-no-emojis
|
26
20
|
}
|
27
21
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
@emoji_map = {}
|
33
|
-
@encoding_map = {}
|
22
|
+
Class_blacklist = %w{
|
23
|
+
no-emoji
|
24
|
+
no-emojis
|
34
25
|
|
35
|
-
|
36
|
-
|
26
|
+
no_emoji
|
27
|
+
no_emojis
|
28
|
+
}
|
37
29
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
emojione_json ||= parser.parse(f)
|
43
|
-
end
|
30
|
+
Element_blacklist = %w{
|
31
|
+
code
|
32
|
+
pre
|
33
|
+
}
|
44
34
|
|
45
|
-
|
46
|
-
|
47
|
-
unicode = codepoints.map(&:hex).pack("U*")
|
35
|
+
def initialize(conf = nil)
|
36
|
+
parser = Yajl::Parser.new
|
48
37
|
|
49
|
-
|
50
|
-
|
38
|
+
@@site_conf = conf
|
39
|
+
configure(@@site_conf)
|
51
40
|
|
52
|
-
|
53
|
-
|
54
|
-
|
41
|
+
formats = %w{
|
42
|
+
html
|
43
|
+
unicode
|
44
|
+
emojione-png
|
45
|
+
emojione-svg
|
55
46
|
}
|
56
47
|
|
57
|
-
|
58
|
-
@
|
59
|
-
|
60
|
-
|
48
|
+
if !formats.include? @conf['format']
|
49
|
+
raise(ArgumentError, "Unknown emoji format: '#{@conf['format']}'; Supported formats are: #{formats}")
|
50
|
+
end
|
51
|
+
|
52
|
+
@emoji_map = {}
|
53
|
+
@encoding_map = {}
|
54
|
+
|
55
|
+
@shortname_aliases = []
|
56
|
+
@ascii_aliases = []
|
57
|
+
|
58
|
+
# This JSON file is nicked from the Emoji One project
|
59
|
+
# Go shower them in love (not that kinda love :smirk:).
|
60
|
+
emojione_json = nil
|
61
|
+
File.open(File.expand_path('../../../emoji.json', __FILE__), 'r') do |f|
|
62
|
+
emojione_json ||= parser.parse(f)
|
63
|
+
end
|
64
|
+
|
65
|
+
emojione_json.each_value do |v|
|
66
|
+
codepoints = v['unicode'].split('-')
|
67
|
+
unicode = codepoints.map(&:hex).pack("U*")
|
61
68
|
|
62
|
-
|
63
|
-
|
69
|
+
@shortname_aliases << v['shortname']
|
70
|
+
@emoji_map[v['shortname']] = v['unicode']
|
71
|
+
|
72
|
+
v['aliases'].each do |emoji_alias|
|
73
|
+
@shortname_aliases << emoji_alias
|
74
|
+
@emoji_map[emoji_alias] = v['unicode']
|
75
|
+
end
|
76
|
+
|
77
|
+
v['aliases_ascii'].each do |emoji_alias|
|
78
|
+
@ascii_aliases << emoji_alias
|
79
|
+
@emoji_map[emoji_alias] = v['unicode']
|
80
|
+
end
|
81
|
+
|
82
|
+
@encoding_map[unicode] = codepoints.map{|cp| "&#x#{cp};" }.join
|
83
|
+
@emoji_map[unicode] = v['unicode']
|
84
|
+
end
|
85
|
+
|
86
|
+
build_emoji_regexp
|
87
|
+
|
88
|
+
# @emoji_regexp = Regexp.new (@emoji_map.keys.map{|k| Regexp.quote(k) }).join('|')
|
89
|
+
@encoding_regexp = Regexp.new (@encoding_map.keys.map{|k| Regexp.quote(k) }).join('|')
|
64
90
|
end
|
65
91
|
|
66
|
-
build_emoji_regexp
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
valid = @encoding_map.keys
|
76
|
-
valid += @shortname_aliases if @conf['shortname']
|
77
|
-
valid += @ascii_aliases if @conf['ascii']
|
78
|
-
|
79
|
-
@emoji_regexp = Regexp.union(valid)
|
80
|
-
end
|
81
|
-
|
82
|
-
def reconfigure(h)
|
83
|
-
@old_conf = @conf
|
84
|
-
@conf = @@site_conf['emoji'].merge(h){|k, o, n| n.nil? ? o : n }
|
85
|
-
build_emoji_regexp
|
86
|
-
end
|
87
|
-
|
88
|
-
def matches(ext)
|
89
|
-
ext =~ /^\.(md|markdown)$/i
|
90
|
-
end
|
91
|
-
|
92
|
-
def output_ext(ext)
|
93
|
-
".html"
|
94
|
-
end
|
95
|
-
|
96
|
-
##
|
97
|
-
# Return whether whether `node` should contain emojis or not
|
98
|
-
#
|
99
|
-
# @param [Oga::XML::Node] node
|
100
|
-
#
|
101
|
-
# @return [Boolean]
|
102
|
-
#
|
103
|
-
def emoji_enabled?(node)
|
104
|
-
|
105
|
-
return true if node.is_a? Oga::XML::Document
|
106
|
-
|
107
|
-
if node.is_a? Oga::XML::Element
|
108
|
-
classes = node.get('class')
|
109
|
-
return false if node.name == 'code'
|
110
|
-
return false if node.name == 'pre'
|
111
|
-
return false if node.get('data-no-emoji')
|
112
|
-
return false if !classes.nil? && classes[/no[-_]emoji/]
|
92
|
+
def build_emoji_regexp(previous_conf = nil)
|
93
|
+
return if previous_conf == @conf
|
94
|
+
|
95
|
+
valid = @encoding_map.keys
|
96
|
+
valid += @shortname_aliases if @conf['shortname']
|
97
|
+
valid += @ascii_aliases if @conf['ascii']
|
98
|
+
|
99
|
+
@emoji_regexp = Regexp.union(valid)
|
113
100
|
end
|
114
101
|
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
##
|
119
|
-
# Recursively add emojis to all child nodes
|
120
|
-
#
|
121
|
-
# @param [Oga::XML::Document|Oga::XML::Node|Oga::XML::Element] node
|
122
|
-
#
|
123
|
-
# @return [NilClass]
|
124
|
-
#
|
125
|
-
def add_emojis(node)
|
126
|
-
return unless emoji_enabled?(node)
|
127
|
-
|
128
|
-
node.children.each do |child|
|
129
|
-
if child.is_a?(Oga::XML::Text)
|
130
|
-
process_node(child)
|
102
|
+
def configure(h)
|
103
|
+
if h['emoji']
|
104
|
+
@conf = Defaults.merge(h['emoji'])
|
131
105
|
else
|
132
|
-
|
106
|
+
@conf = Defaults
|
133
107
|
end
|
134
108
|
end
|
135
109
|
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
img.set('alt', unicode_emoji)
|
168
|
-
img.set('src', "https://cdn.jsdelivr.net/#{vendor}/assets/#{ext}/#{codepoints}.#{ext}")
|
169
|
-
|
170
|
-
if node.node_set
|
171
|
-
node.before(before)
|
172
|
-
node.after(after)
|
173
|
-
node.replace img
|
174
|
-
end
|
110
|
+
def reconfigure(h)
|
111
|
+
previous_conf = @conf
|
112
|
+
@conf = configure(@@site_conf).merge(h){|k, o, n| n.nil? ? o : n }
|
113
|
+
build_emoji_regexp(previous_conf)
|
114
|
+
end
|
115
|
+
|
116
|
+
def matches(ext)
|
117
|
+
ext =~ /^\.(md|markdown)$/i
|
118
|
+
end
|
119
|
+
|
120
|
+
def output_ext(ext)
|
121
|
+
".html"
|
122
|
+
end
|
123
|
+
|
124
|
+
##
|
125
|
+
# Return whether whether `node` should contain emojis or not
|
126
|
+
#
|
127
|
+
# @param [Oga::XML::Node] node
|
128
|
+
#
|
129
|
+
# @return [Boolean]
|
130
|
+
#
|
131
|
+
def emoji_enabled?(node)
|
132
|
+
|
133
|
+
return true if node.is_a? Oga::XML::Document
|
134
|
+
|
135
|
+
if node.is_a? Oga::XML::Element
|
136
|
+
classes = node.get('class')
|
137
|
+
|
138
|
+
return false if Element_blacklist.any? {|e| e == node.name }
|
139
|
+
return false if Attribute_blacklist.any? {|a| node.attr(a) }
|
140
|
+
return false unless (Class_blacklist & classes.split).empty? unless classes.nil?
|
175
141
|
|
176
142
|
end
|
143
|
+
|
144
|
+
return true
|
177
145
|
end
|
178
146
|
|
179
|
-
|
180
|
-
|
147
|
+
##
|
148
|
+
# Recursively add emojis to all child nodes
|
149
|
+
#
|
150
|
+
# @param [Oga::XML::Document|Oga::XML::Node|Oga::XML::Element] node
|
151
|
+
#
|
152
|
+
# @return [NilClass]
|
153
|
+
#
|
154
|
+
def add_emojis(node)
|
155
|
+
return unless emoji_enabled?(node)
|
156
|
+
|
157
|
+
node.children.each do |child|
|
158
|
+
if child.is_a?(Oga::XML::Text)
|
159
|
+
process_node(child)
|
160
|
+
else
|
161
|
+
add_emojis(child)
|
162
|
+
end
|
163
|
+
end
|
181
164
|
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
165
|
+
return nil
|
166
|
+
end
|
167
|
+
|
168
|
+
##
|
169
|
+
# Add emojis to {Oga::XML::Text} node
|
170
|
+
#
|
171
|
+
# @param [Oga::XML::Text] node
|
172
|
+
#
|
173
|
+
# @return [NilClass]
|
174
|
+
#
|
175
|
+
def process_node(node)
|
176
|
+
str = node.text
|
177
|
+
str.gsub!(@emoji_regexp) do |m|
|
178
|
+
codepoints = @emoji_map[m]
|
179
|
+
|
180
|
+
unicode_emoji = codepoints.split('-').map(&:hex).pack("U*")
|
181
|
+
|
182
|
+
case @conf['format']
|
183
|
+
when 'unicode', 'html'
|
184
|
+
unicode_emoji
|
185
|
+
when 'emojione-png', 'emojione-svg'
|
186
|
+
vendor, ext = @conf['format'].split('-')
|
187
|
+
loc = str.index(m)
|
188
|
+
|
189
|
+
before = Oga::XML::Text.new
|
190
|
+
after = Oga::XML::Text.new
|
191
|
+
|
192
|
+
before.text = str[0...loc]
|
193
|
+
after.text = str[loc + m.length..-1]
|
194
|
+
img = Oga::XML::Element.new name: 'img'
|
195
|
+
img.set('class', vendor)
|
196
|
+
img.set('alt', unicode_emoji)
|
197
|
+
img.set('src', "https://cdn.jsdelivr.net/#{vendor}/assets/#{ext}/#{codepoints}.#{ext}")
|
198
|
+
|
199
|
+
if node.node_set
|
200
|
+
node.before(before)
|
201
|
+
node.after(after)
|
202
|
+
node.replace img
|
203
|
+
end
|
204
|
+
|
205
|
+
end
|
206
|
+
end
|
186
207
|
|
187
|
-
|
188
|
-
if @conf['format'] == 'html'
|
189
|
-
docstr.gsub!(@encoding_regexp, @encoding_map)
|
208
|
+
return nil
|
190
209
|
end
|
191
210
|
|
192
|
-
|
193
|
-
|
211
|
+
def convert(content)
|
212
|
+
document = Oga.parse_html(content)
|
213
|
+
add_emojis(document)
|
214
|
+
docstr = document.to_xml
|
194
215
|
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
216
|
+
# Now we only need to encode the Emojis into HTML Entities
|
217
|
+
if @conf['format'] == 'html'
|
218
|
+
docstr.gsub!(@encoding_regexp, @encoding_map)
|
219
|
+
end
|
199
220
|
|
200
|
-
|
201
|
-
|
202
|
-
@@emoji_converter ||= EmojiConverter.new('emoji' => EmojiConverter.site_conf['emoji'])
|
221
|
+
return docstr
|
222
|
+
end # convert
|
203
223
|
|
204
|
-
|
224
|
+
def self.site_conf
|
225
|
+
@@site_conf
|
226
|
+
end
|
227
|
+
end #Converter
|
228
|
+
|
229
|
+
module Filter
|
230
|
+
def emojify(input, output_format = nil, ascii = nil, shortname = nil)
|
231
|
+
@@emoji_converter ||= Converter.new(Converter.site_conf)
|
232
|
+
@@emoji_converter.reconfigure('format' => output_format, 'ascii' => ascii, 'shortname' => shortname)
|
233
|
+
|
234
|
+
output = @@emoji_converter.convert(input)
|
205
235
|
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
236
|
+
# NOTE: This impacts performance in certain cases
|
237
|
+
@@emoji_converter.reconfigure(Converter.site_conf)
|
238
|
+
|
239
|
+
return output
|
240
|
+
end
|
241
|
+
end #Filter
|
242
|
+
end #Emoji
|
210
243
|
end
|
211
244
|
|
212
|
-
Liquid::Template.register_filter(Jekyll::
|
245
|
+
Liquid::Template.register_filter(Jekyll::Emoji::Filter)
|
data/lib/jekyll/emoji/version.rb
CHANGED
data/tests/conversion_test.rb
CHANGED
@@ -4,7 +4,7 @@ require_relative '../lib/jekyll-emoji'
|
|
4
4
|
|
5
5
|
class TestConversion < MiniTest::Test
|
6
6
|
def setup
|
7
|
-
@converter = Jekyll::
|
7
|
+
@converter = Jekyll::Emoji::Converter.new('emoji' => {
|
8
8
|
'format': 'html',
|
9
9
|
'ascii' => true,
|
10
10
|
'shortname' => true
|
@@ -31,4 +31,45 @@ class TestConversion < MiniTest::Test
|
|
31
31
|
assert_equal img, @converter.convert(":three:")
|
32
32
|
assert_equal "3", @converter.convert("3")
|
33
33
|
end
|
34
|
+
|
35
|
+
def test_reconfiguring_aliases
|
36
|
+
@converter.reconfigure 'ascii' => false
|
37
|
+
assert_equal ":)", @converter.convert(":)")
|
38
|
+
|
39
|
+
# Return to default state
|
40
|
+
@converter.reconfigure 'ascii' => true
|
41
|
+
end
|
42
|
+
|
43
|
+
def test_class_blacklists
|
44
|
+
test1 = %q{<span class="very-serious-text no-emojis">:)</span>}
|
45
|
+
result1 = %q{<span class="very-serious-text no-emojis">:)</span>}
|
46
|
+
|
47
|
+
test2 = %q{<span class="very-serious-text no-emojiz">:)</span>}
|
48
|
+
result2 = %q{<span class="very-serious-text no-emojiz">😄</span>}
|
49
|
+
|
50
|
+
assert_equal result1, @converter.convert(test1)
|
51
|
+
assert_equal result2, @converter.convert(test2)
|
52
|
+
end
|
53
|
+
|
54
|
+
def test_attr_blacklists
|
55
|
+
test1 = %q{<span data-no-emojis>:)</span>}
|
56
|
+
result1 = %q{<span data-no-emojis="">:)</span>}
|
57
|
+
|
58
|
+
test2 = %q{<span data-no-emojiz>:)</span>}
|
59
|
+
result2 = %q{<span data-no-emojiz="">😄</span>}
|
60
|
+
|
61
|
+
assert_equal result1, @converter.convert(test1)
|
62
|
+
assert_equal result2, @converter.convert(test2)
|
63
|
+
end
|
64
|
+
|
65
|
+
def test_attr_blacklists
|
66
|
+
test1 = %q{<code>:)</code>}
|
67
|
+
result1 = %q{<code>:)</code>}
|
68
|
+
|
69
|
+
test2 = %q{<span>:)</span>}
|
70
|
+
result2 = %q{<span>😄</span>}
|
71
|
+
|
72
|
+
assert_equal result1, @converter.convert(test1)
|
73
|
+
assert_equal result2, @converter.convert(test2)
|
74
|
+
end
|
34
75
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-emoji
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nino Miletich
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -17,7 +17,7 @@ dependencies:
|
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.10'
|
20
|
-
type: :
|
20
|
+
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
@@ -31,13 +31,27 @@ dependencies:
|
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '10.0'
|
34
|
-
type: :
|
34
|
+
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: minitest
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '5.8'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '5.8'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: jekyll
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -56,21 +70,30 @@ dependencies:
|
|
56
70
|
name: yajl-ruby
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
58
72
|
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '1.2'
|
59
76
|
- - ">="
|
60
77
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
78
|
+
version: 1.2.0
|
62
79
|
type: :runtime
|
63
80
|
prerelease: false
|
64
81
|
version_requirements: !ruby/object:Gem::Requirement
|
65
82
|
requirements:
|
83
|
+
- - "~>"
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '1.2'
|
66
86
|
- - ">="
|
67
87
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
88
|
+
version: 1.2.0
|
69
89
|
- !ruby/object:Gem::Dependency
|
70
90
|
name: oga
|
71
91
|
requirement: !ruby/object:Gem::Requirement
|
72
92
|
requirements:
|
73
93
|
- - "~>"
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '1.2'
|
96
|
+
- - ">="
|
74
97
|
- !ruby/object:Gem::Version
|
75
98
|
version: 1.2.0
|
76
99
|
type: :runtime
|
@@ -78,9 +101,13 @@ dependencies:
|
|
78
101
|
version_requirements: !ruby/object:Gem::Requirement
|
79
102
|
requirements:
|
80
103
|
- - "~>"
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: '1.2'
|
106
|
+
- - ">="
|
81
107
|
- !ruby/object:Gem::Version
|
82
108
|
version: 1.2.0
|
83
|
-
description:
|
109
|
+
description: "\n A plug-n-play Jekyll plugin to enable emoji support in your site.\n\n
|
110
|
+
\ See documentation for more inforamtion on how to use it.\n "
|
84
111
|
email:
|
85
112
|
- nino@miletich.me
|
86
113
|
executables: []
|
@@ -112,7 +139,10 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
112
139
|
requirements:
|
113
140
|
- - ">="
|
114
141
|
- !ruby/object:Gem::Version
|
115
|
-
version: '
|
142
|
+
version: '1.9'
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '2.2'
|
116
146
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
117
147
|
requirements:
|
118
148
|
- - ">="
|