diff --git a/js/markdown.js b/js/markdown.js
index 86182ba..2f01302 100644
--- a/js/markdown.js
+++ b/js/markdown.js
@@ -30,7 +30,13 @@ function filterMentions(text) {
const emojiregex = /:([^:\s]*):/gi
function emojify(text) {
- return text.replace(emojiregex,"")
+ return text.replace(emojiregex,"
title=':$1:'")
+}
+
+function unemojify(text){
+ text = text.replace(/\u{1F5FF}/gu,":moyai:")
+ text = text.replace(/\u{1F440}/gu,":eyes:")
+ return text
}
const allregex = /(```([^```]*)```)|(\n)|(~([^~]*)~)|(\*\*([^\*]*)\*\*)|(\*([^\*]*)\*)|(@[^\s]*)|(:([^:\s]*):)/gi
@@ -43,6 +49,7 @@ const cdblregex = /```([^```]*)```/gi
* @return {string} html that represents the filtered text
*/
function filterPost(text){
+ text = unemojify(text)
let result = htmlesc(text).replace(allregex, function (match) {
let out = match
if(cdblregex.test(match)) {
@@ -51,7 +58,6 @@ function filterPost(text){
out = newlineify(out)
return `
${out}