diff --git a/js/htmlescape.js b/js/htmlescape.js
index 6a4faf2..042a016 100644
--- a/js/htmlescape.js
+++ b/js/htmlescape.js
@@ -35,3 +35,11 @@ const unes = {
const cape = m => unes[m];
const unescape = un => replace.call(un, es, cape);
+
+function escape_special(str) {
+ return str.replace("\\","\\\\").replace("`","\\`")
+}
+
+function unescape_special(str) {
+ return str.replace("\\\\","\\").replace("\\`","`")
+}
diff --git a/js/posts.js b/js/posts.js
index bbffe76..5bf3dc7 100644
--- a/js/posts.js
+++ b/js/posts.js
@@ -112,7 +112,7 @@ async function createPost(username,text,time,specialtext,postid,isbot,reply_id)
}
newP.appendChild(spacerTextNode())
// |\>.|
- newP.innerHTML += ``
+ newP.innerHTML += ``
if(reply_id != 0) {
try {
@@ -182,7 +182,7 @@ async function main(){
function reply(username,postid,posttext) {
document.getElementById("reply").style = ""
document.getElementById("reply_username").innerText = username
- document.getElementById("reply_text").innerHTML = filterPost(unescape(posttext.replace("\\\\","\\").replace("\\`","`")))
+ document.getElementById("reply_text").innerHTML = filterPost(unescape(unescape_special(unescape_special(posttext))))
reply_id = postid
}