Skip to content

Node.js based forum software built for the modern web

fix: #13889, custom emoji from Piefed

Julian Lam0c75934adf40
diff --git a/src/posts/create.js b/src/posts/create.js
index 064e337a94..044b07d699 100644
--- a/src/posts/create.js
+++ b/src/posts/create.js
@@ -60,7 +60,8 @@ module.exports = function (Posts) {
tag.name = `${tag.name}:`;
}
- postData.content = postData.content.replace(new RegExp(tag.name, 'g'), `<img class="not-responsive emoji" src="${tag.icon.url}" title="${tag.name}" />`);
+ const property = postData.sourceContent && !postData.content ? 'sourceContent' : 'content';
+ postData[property] = postData[property].replace(new RegExp(tag.name, 'g'), `<img class="not-responsive emoji" src="${tag.icon.url}" title="${tag.name}" />`);
});
}