mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-20 23:40:38 +01:00
fix: closes #12819, add helper to escape tx strings
This commit is contained in:
@@ -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') {
|
||||
|
||||
Reference in New Issue
Block a user