Use Html2Text to generate plaintext for keyword mutes. #236.

This allows us to match URLs inside link hrefs.
This commit is contained in:
David Yip
2018-02-10 10:32:14 -06:00
parent 9105b0c954
commit f1f67c46c5
2 changed files with 9 additions and 6 deletions

View File

@ -39,5 +39,12 @@ RSpec.describe Glitch::KeywordMuteHelper do
expect(helper.matches?(status)).to be true
end
it 'matches link hrefs in HTML text' do
status = Fabricate(:status, text: '<p><a href="https://example.com/it-was-milk">yep</a></p>')
Glitch::KeywordMute.create!(account: alice, keyword: 'milk')
expect(helper.matches?(status)).to be true
end
end
end