Notification false positives

Fixes #7
This commit is contained in:
Keath Milligan 2025-04-27 22:22:15 -05:00
parent 1320ccc231
commit 63610697ed
No known key found for this signature in database
GPG key ID: D98D37E8D3A8825C
2 changed files with 8 additions and 2 deletions

View file

@ -22,8 +22,11 @@ export function transformHTML(
for (const replacement of settings.htmlRegexReplacements) {
try {
const regex = new RegExp(replacement.pattern, 'g');
const originalHtml = html;
html = html.replace(regex, replacement.replacement);
appliedTransformations = true;
if (originalHtml !== html) {
appliedTransformations = true;
}
} catch (error) {
console.error(`Error applying regex replacement: ${error}`);
}

View file

@ -27,8 +27,11 @@ export function transformMarkdown(
for (const replacement of settings.markdownRegexReplacements) {
try {
const regex = new RegExp(replacement.pattern, 'g');
const originalMarkdown = markdown;
markdown = markdown.replace(regex, replacement.replacement);
appliedTransformations = true;
if (originalMarkdown !== markdown) {
appliedTransformations = true;
}
} catch (error) {
console.error(`Error applying markdown regex replacement: ${error}`);
}