Sha256: 42850022b4e6a75471106b9fa1280f560f52fb894f022a6ab71307fad693f168

Contents?: true

Size: 343 Bytes

Versions: 27

Compression:

Stored size: 343 Bytes

Contents

module EmojiHelper

  def emojify(content)
    content.to_str.gsub(/:([a-z0-9\+\-_]+):/) do |match|
      if Emoji.all.map(&:name).include?($1)
        "<img alt=\"#{$1}\" height=\"20\" width=\"20\" src=\"#{image_url("emoji/#{$1}.png")}\" class=\"emoji\" />"
      else
        match
      end
    end.html_safe if content.present?
  end

end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
houston-core-0.9.2 app/helpers/emoji_helper.rb
houston-core-0.9.1 app/helpers/emoji_helper.rb
houston-core-0.9.0 app/helpers/emoji_helper.rb
houston-core-0.9.0.rc1 app/helpers/emoji_helper.rb
houston-core-0.8.4 app/helpers/emoji_helper.rb
houston-core-0.8.3 app/helpers/emoji_helper.rb
houston-core-0.8.2 app/helpers/emoji_helper.rb
houston-core-0.8.1 app/helpers/emoji_helper.rb
houston-core-0.8.0 app/helpers/emoji_helper.rb
houston-core-0.8.0.pre2 app/helpers/emoji_helper.rb
houston-core-0.8.0.pre app/helpers/emoji_helper.rb
houston-core-0.7.0 app/helpers/emoji_helper.rb
houston-core-0.7.0.beta4 app/helpers/emoji_helper.rb
houston-core-0.7.0.beta3 app/helpers/emoji_helper.rb
houston-core-0.7.0.beta2 app/helpers/emoji_helper.rb
houston-core-0.7.0.beta app/helpers/emoji_helper.rb
houston-core-0.6.3 app/helpers/emoji_helper.rb
houston-core-0.6.2 app/helpers/emoji_helper.rb
houston-core-0.6.1 app/helpers/emoji_helper.rb
houston-core-0.6.0 app/helpers/emoji_helper.rb