mumukit-content-type 1.8.0 → 1.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8baed646c92124b23f37c412d8454df79dd259badcf2eaa1530fbbbacff5f263
4
- data.tar.gz: ac9ab3446c9af66333bf0ddc3d8b7338b22ae55fc7f6eb5dfb92e7b072ed9a76
3
+ metadata.gz: 2639ef97bf0f0aa18b30ecf68e13c00ff35489817185eb33cb4994cc4d3c34d5
4
+ data.tar.gz: 757d5badf75ff9a5ee8e799308e155a39a5049ed98e077e8a8fd1c1b0d212397
5
5
  SHA512:
6
- metadata.gz: b4afb97ee386fb81475f5c4475ef41e22200fe43ccdcfb7340f62ae42a30d7046107a27446249641a15451d4da07e6acb95cf346fc742cd14738acadb2f2e689
7
- data.tar.gz: 9ad8a5ae90876386ff7f4a123acaee9fbe157c92d02fb81e51da97617a3284cd663511a215f6c639662ca28f739bbec9ea5fbfabbf41454b25c074d1e260fc99
6
+ metadata.gz: dcfbd78109450fc46f919108c3e98be2039f2de51855897f1577708c63cb6de474d78c37baa4dbc1a6176970cdbb5a56b8a5860f071cdf840889d1586b190d04
7
+ data.tar.gz: dff6bbc9434d06e3ada387b3a911b150bf17e815d709e3476f9696458f57c3dc47d20a6f0047b36dd5c964de426cc073a31b23cfe92dfe5145bed6aa713899a4
@@ -22,14 +22,13 @@ module Mumukit::ContentType::Emoji
22
22
  # Valid emoji charaters are listed in +Mumukit::ContentType::Emoji::EMOJI+
23
23
  def replace_emoji(text)
24
24
  emojis = Mumuki::Emojis::EMOJIS
25
- short_names = emojis.keys.join('|').gsub('+', '\+')
26
- text.gsub(/:(#{short_names}):/) do |short_name|
25
+ text.gsub(/:([^\s:])+:/) do |short_name|
27
26
  short_code = short_name.gsub(':', '')
28
- if emojis.include?(short_code)
29
- emoji = emojis[short_code]
27
+ emoji = emojis[short_code]
28
+ if emoji
30
29
  %{<i class="mu-emoji #{emoji['ca']} _#{emoji['co']}" title="#{short_name}"></i>}
31
30
  else
32
- short_code
31
+ short_name
33
32
  end
34
33
  end
35
34
  end
@@ -1,5 +1,5 @@
1
1
  module Mumukit
2
2
  module ContentType
3
- VERSION = '1.8.0'
3
+ VERSION = '1.8.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumukit-content-type
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.0
4
+ version: 1.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franco Leonardo Bulgarelli
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-08-20 00:00:00.000000000 Z
11
+ date: 2019-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler