Skip to content

Commit

Permalink
Fixed bugs with replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
fastnlight0 committed Jan 24, 2024
1 parent 1c1d6f1 commit 1f9a221
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions dist/AdvancedFlagging.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -3726,9 +3726,9 @@
if (comment) {
const sitename = StackExchange.options.site.name || "";
const siteurl = window.location.hostname;
comment = comment.replaceAll(/%SITENAME%/, sitename);
comment = comment.replaceAll(/%SITEURL%/, siteurl);
comment = comment.replaceAll(/%OP%/, opName);
comment = comment.replace(/%SITENAME%/g, sitename);
comment = comment.replace(/%SITEURL%/g, siteurl);
comment = comment.replace(/%OP%/g, opName);
}
return (comment && AddAuthorName ? `${opName}, ${comment[0].toLowerCase()}${comment.slice(1)}` : comment) || null;
}
Expand Down
6 changes: 3 additions & 3 deletions src/popover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,9 @@ function getCommentText(
const sitename = StackExchange.options.site.name || '';
const siteurl = window.location.hostname;

comment = comment.replaceAll(/%SITENAME%/, sitename);
comment = comment.replaceAll(/%SITEURL%/, siteurl);
comment = comment.replaceAll(/%OP%/, opName);
comment = comment.replace(/%SITENAME%/g, sitename);
comment = comment.replace(/%SITEURL%/g, siteurl);
comment = comment.replace(/%OP%/g, opName);
}

return (
Expand Down

0 comments on commit 1f9a221

Please sign in to comment.