Currently the word filtering provided by this module is case-insensitive. If you are replacing "word" with "another word", it will find occasions like "Word" and replace them with "another word" as well.
The problem is that if the original word was capitalized because it was at the beginning of a sentence, you want the capitalization to be respected in the replacement as well.
I propose a feature whereby capitalization is respected, such that you can enter two replacement rules (one for "word" => "another word" and the other for "Word" => "Another word") and thereby have the correct capitalization.
This should perhaps be an optional feature (i.e., a checkbox on the form for adding new filtered words), but for now I just have a patch that makes the change for all word replacements.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | wordfilter-case-sensitive-2045243-1.patch | 710 bytes | David_Rothstein |
Comments
Comment #1
David_Rothstein commentedHere is the patch.
Comment #2
David_Rothstein commentedRelated (but postponed): #781560: Case-sensitiveness? .... so if I had noticed that one before I probably would have just reopened it rather than creating a new issue here.
Comment #3
jaydub commentedFeature added as a global option for now, with possibility for per search word/replacement word pair option later. See #781560: Case-sensitiveness?.