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