diff --git a/js/htmlescape.js b/js/htmlescape.js
index 824a302..6a4faf2 100644
--- a/js/htmlescape.js
+++ b/js/htmlescape.js
@@ -1,7 +1,7 @@
const {replace} = '';
-const es = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34);/g;
-const ca = /[&<>'"]/g;
+const es = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|\\\\|`);/g;
+const ca = /[&<>'"\\\\`]/g;
const esca = {
'&': '&',
@@ -9,8 +9,8 @@ const esca = {
'>': '>',
"'": ''',
'"': '"',
-'\\': '\\\\',
-'`': '\\`'
+'`': '\\`',
+'\\': '\\\\'
};
const pe = m => esca[m];
@@ -29,8 +29,8 @@ const unes = {
''': "'",
'"': '"',
'"': '"',
-'\\\\': '\\',
-'\\`': '`'
+'\\`': '`',
+'\\\\': '\\'
};
const cape = m => unes[m];