add escaping for ` and \

This commit is contained in:
Mystikfluu 2022-07-03 11:13:16 +02:00
parent c107a1a1f0
commit f29ab9c96f

View File

@ -8,7 +8,9 @@ const esca = {
'<': '&lt;',
'>': '&gt;',
"'": '&#39;',
'"': '&quot;'
'"': '&quot;',
'\\': '\\\\',
'`': '\\`'
};
const pe = m => esca[m];
@ -26,7 +28,9 @@ const unes = {
'&apos;': "'",
'&#39;': "'",
'&quot;': '"',
'&#34;': '"'
'&#34;': '"',
'\\\\': '\\',
'\\`': '`'
};
const cape = m => unes[m];