Sha256: 752dc5535326738db17238d7ccb2b8b84418e5931908bc5d11f8cc485316e456

Contents?: true

Size: 554 Bytes

Versions: 1

Compression:

Stored size: 554 Bytes

Contents

module HTML
  class Pipeline
    # This class is very similar EmojiFilter. It removes the inline
    # width/height attributes so that reveal-ck supplied CSS takes effect.
    class RevealCKEmojiFilter < EmojiFilter
      def emoji_image_filter(text)
        return text unless text.include?(':')

        text.gsub(emoji_pattern) do
          name = Regexp.last_match[1]
          result = "<img class='emoji' title=':#{name}:' alt=':#{name}:' "
          result + "src='#{emoji_url(name)}' align='absmiddle' />"
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
reveal-ck-3.2.0 lib/html/pipeline/reveal_ck_emoji_filter.rb