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