Skip to content

Node.js based forum software built for the modern web

fix: search post snipets incase content is plain text

Barış Soner Uşaklıada45a34d5c7
diff --git a/public/src/app.js b/public/src/app.js
index 67058eb516..8d8568e9cf 100644
--- a/public/src/app.js
+++ b/public/src/app.js
@@ -596,7 +596,7 @@ app.cacheBuster = null;
$(window).trigger('action:search.quick', { data: data });
search.api(data, function (data) {
data.posts.forEach(function (p) {
- p.snippet = utils.escapeHTML($(p.content).text().slice(0, 80) + '...');
+ p.snippet = utils.escapeHTML($('<div>' + p.content + '</div>').text().slice(0, 80) + '...');
});
app.parseAndTranslate(template, data, function (html) {
if (html.length) {