From f29ab9c96f16ac9aa39bf266ff9ce500a325a2aa Mon Sep 17 00:00:00 2001 From: Mystikfluu Date: Sun, 3 Jul 2022 11:13:16 +0200 Subject: [PATCH] add escaping for ` and \ --- js/htmlescape.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/js/htmlescape.js b/js/htmlescape.js index a95c84b..824a302 100644 --- a/js/htmlescape.js +++ b/js/htmlescape.js @@ -8,7 +8,9 @@ const esca = { '<': '<', '>': '>', "'": ''', -'"': '"' +'"': '"', +'\\': '\\\\', +'`': '\\`' }; const pe = m => esca[m]; @@ -26,7 +28,9 @@ const unes = { ''': "'", ''': "'", '"': '"', -'"': '"' +'"': '"', +'\\\\': '\\', +'\\`': '`' }; const cape = m => unes[m];