case insensitive word filters

このコミットが含まれているのは:
n9k 2021-07-18 04:21:23 +00:00
コミット b3e9af24ac
1個のファイルの変更1行の追加1行の削除

ファイルの表示

@ -142,7 +142,7 @@ def _comment(text, token, c_response, c_ciphertext, nonce):
word = escape(word) # escape for html
word = re.escape(word) # escape for regex
regex = r'\b{}\b'.format(word)
markup, n = re.subn(regex, '<b class="censored">[CENSORED]</b>', markup)
markup, n = re.subn(regex, '<b class="censored">[CENSORED]</b>', markup, flags=re.IGNORECASE)
if n: reaction = key
# enact consequences of word filters
note = N_NONE