mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 20:44:04 +00:00
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:
committed by
Tim Abbott
parent
44c4b93f6e
commit
64cabae46d
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user