mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 09:08:10 +08:00
DEV: Refactor watched words (#24163)
- Ignore only invalid words, not all words if one of them is invalid - The naming scheme for methods was inconsistent - Optimize regular expressions
This commit is contained in:
@ -210,7 +210,7 @@ class SiteSerializer < ApplicationSerializer
|
||||
end
|
||||
|
||||
def censored_regexp
|
||||
WordWatcher.serializable_word_matcher_regexp(:censor, engine: :js)
|
||||
WordWatcher.serialized_regexps_for_action(:censor, engine: :js)
|
||||
end
|
||||
|
||||
def custom_emoji_translation
|
||||
@ -226,11 +226,11 @@ class SiteSerializer < ApplicationSerializer
|
||||
end
|
||||
|
||||
def watched_words_replace
|
||||
WordWatcher.word_matcher_regexps(:replace, engine: :js)
|
||||
WordWatcher.regexps_for_action(:replace, engine: :js)
|
||||
end
|
||||
|
||||
def watched_words_link
|
||||
WordWatcher.word_matcher_regexps(:link, engine: :js)
|
||||
WordWatcher.regexps_for_action(:link, engine: :js)
|
||||
end
|
||||
|
||||
def categories
|
||||
|
Reference in New Issue
Block a user