mastodon/spec
David Yip 4b68e82a19 Don't add \b to whole-word keywords that don't start with word characters.
Ditto for ending with \b.

Consider muting the phrase "(hot take)".  I stipulate it is reasonable
to enter this with the default "match whole word" behavior.  Under the
old behavior, this would be encoded as

    \b\(hot\ take\)\b

However, if \b is before the first character in the string and the first
character in the string is not a word character, then the match will
fail.  Ditto for after.  In our example, "(" is not a word character, so
this will not match statuses containing "(hot take)", and that's a very
surprising behavior.

To address this, we only add leading and trailing \b to keywords that
start or end with word characters.
2017-10-22 00:38:54 -05:00
..
controllers Set up /settings/keyword_mutes. #164. 2017-10-21 14:54:36 -05:00
fabricators Apply keyword mutes to reblogs. 2017-10-21 15:44:47 -05:00
features
fixtures
helpers Set up /settings/keyword_mutes. #164. 2017-10-21 14:54:36 -05:00
lib keyword mutes: also check spoiler (CW) text and reblogged statuses. 2017-10-22 00:38:53 -05:00
mailers
models Don't add \b to whole-word keywords that don't start with word characters. 2017-10-22 00:38:54 -05:00
policies
presenters
requests
routing
services
support
validators
views
workers
rails_helper.rb
spec_helper.rb