Skip to content

Commit

Permalink
fix(regex): add 'gi' as default flags for regex
Browse files Browse the repository at this point in the history
  • Loading branch information
Mara-Li committed Nov 28, 2022
1 parent 338a070 commit c30c571
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion plugin/contents_conversion/findAndReplaceText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default function findAndReplaceText(text: string, settings: GitHubPublish
}
for (const censor of censoring) {
if ((!censor.flags) || (!censor.flags.match(/^[gimsuy\s]+$/))) {
censor.flags = '';
censor.flags = 'gi';
}
const regex = new RegExp(censor.entry, censor.flags);
// @ts-ignore
Expand Down
2 changes: 1 addition & 1 deletion plugin/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ export class GithubPublisherSettings extends PluginSettingTab {
entry: "",
replace: "",
after: false,
flags: ''
flags: 'gi'
};
this.plugin.settings.censorText.push(censorText);
await this.plugin.saveSettings();
Expand Down

0 comments on commit c30c571

Please sign in to comment.