fix: closes #12819, add helper to escape tx strings

This commit is contained in:
Barış Soner Uşaklı
2024-09-23 16:17:35 -04:00
parent 8bca97685c
commit 7d0c2cb66f
2 changed files with 6 additions and 1 deletions

View File

@@ -107,7 +107,7 @@
"nodebb-plugin-ntfy": "1.7.7",
"nodebb-plugin-spam-be-gone": "2.2.2",
"nodebb-rewards-essentials": "1.0.0",
"nodebb-theme-harmony": "1.2.70",
"nodebb-theme-harmony": "1.2.71",
"nodebb-theme-lavender": "7.1.8",
"nodebb-theme-peace": "2.2.7",
"nodebb-theme-persona": "13.3.37",

View File

@@ -32,6 +32,7 @@ module.exports = function (utils, Benchpress, relative_path) {
shouldHideReplyContainer,
humanReadableNumber,
formattedNumber,
txEscape,
generatePlaceholderWave,
register,
__escape: identity,
@@ -366,6 +367,10 @@ module.exports = function (utils, Benchpress, relative_path) {
return utils.addCommas(number);
}
function txEscape(text) {
return String(text).replace(/%/g, '%').replace(/,/g, ',');
}
function generatePlaceholderWave(items) {
const html = items.map((i) => {
if (i === 'divider') {