fix: preserve falsy values in escapeHtml
This commit is contained in:
@@ -298,7 +298,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function escapeHtml(str) {
|
function escapeHtml(str) {
|
||||||
if (!str) return '';
|
if (str === null || str === undefined) return '';
|
||||||
return String(str)
|
return String(str)
|
||||||
.replace(/&/g, '&')
|
.replace(/&/g, '&')
|
||||||
.replace(/</g, '<')
|
.replace(/</g, '<')
|
||||||
|
|||||||
Reference in New Issue
Block a user