diff --git a/lib/html/pipeline/emoji_filter.rb b/lib/html/pipeline/emoji_filter.rb index 4fc551d5..ee522f42 100644 --- a/lib/html/pipeline/emoji_filter.rb +++ b/lib/html/pipeline/emoji_filter.rb @@ -17,7 +17,7 @@ class EmojiFilter < Filter def call doc.search('text()').each do |node| content = node.to_html - next if !content.include?(':') + next unless content.include?(':') next if has_ancestor?(node, %w(pre code)) html = emoji_image_filter(content) next if html == content @@ -38,8 +38,6 @@ def validate # # Returns a String with :emoji: replaced with images. def emoji_image_filter(text) - return text unless text.include?(':') - text.gsub(emoji_pattern) do |match| name = $1 ":#{name}:"