From 912c1ba787117d9ae2f00a22857bcc2512ce5351 Mon Sep 17 00:00:00 2001 From: Jed Northridge Date: Sun, 27 Sep 2015 21:29:17 -0400 Subject: [PATCH] [emoji-filter] Override emoji_image_tag This is nicer because I want to use everything that EmojiFilter does *except* the image tag generation. The prior implementation had to get involved with finding emojis and gsubbing them out. This possible now because of @kbrock's change over here: https://github.com/jch/html-pipeline/pull/195/ --- lib/html/pipeline/reveal_ck_emoji_filter.rb | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/html/pipeline/reveal_ck_emoji_filter.rb b/lib/html/pipeline/reveal_ck_emoji_filter.rb index bce9468..54edfa1 100644 --- a/lib/html/pipeline/reveal_ck_emoji_filter.rb +++ b/lib/html/pipeline/reveal_ck_emoji_filter.rb @@ -4,13 +4,8 @@ class Pipeline # width/height/align 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] - ":#{name}:" - end + def emoji_image_tag(name) + ":#{name}:" end end end