diff --git a/app/services/search_indexer.rb b/app/services/search_indexer.rb index 6fa15e4a6e6..e774ad4df6d 100644 --- a/app/services/search_indexer.rb +++ b/app/services/search_indexer.rb @@ -328,7 +328,7 @@ class SearchIndexer end end - document.css("img[class='emoji']").each do |node| + document.css("img.emoji").each do |node| node.remove_attribute("alt") end diff --git a/spec/services/search_indexer_spec.rb b/spec/services/search_indexer_spec.rb index 55728786d0d..83a0c51d883 100644 --- a/spec/services/search_indexer_spec.rb +++ b/spec/services/search_indexer_spec.rb @@ -61,8 +61,10 @@ describe SearchIndexer do end it 'extracts emoji name from emoji image' do - html = %Q|:wink:| + emoji = Emoji["wink"] + html = %Q|\":wink:\"| scrubbed = scrub(html) + expect(scrubbed).to eq(':wink:') end