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.

Comments

David_Rothstein’s picture

Status: Active » Needs review
StatusFileSize
new710 bytes

Here is the patch.

David_Rothstein’s picture

Related (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.

jaydub’s picture

Issue summary: View changes
Status: Needs review » Fixed

Feature added as a global option for now, with possibility for per search word/replacement word pair option later. See #781560: Case-sensitiveness?.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.