web: Fix usage of .replace with variable replacement.

String.prototype.replace and String.prototype.replaceAll interpret
certain sequences such as $$ within a string provided as the
replacement argument.  Avoid this interpretation by providing a
function.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2024-04-04 16:48:15 -07:00
committed by Tim Abbott
parent 44c4b93f6e
commit 64cabae46d
2 changed files with 2 additions and 2 deletions

View File

@@ -1188,7 +1188,7 @@ Parser.prototype.parse = function(src) {
if (!safe) {
html = escape(html);
}
output = output.replace('<p>' + key + '</p>', html)
output = output.replace('<p>' + key + '</p>', () => html)
}
return output;
};