1
0
mirror of https://github.com/flarum/core.git synced 2025-08-09 18:07:02 +02:00

Fix discussion search result suggestion excerpts

So that they show the relevant part of the post
This commit is contained in:
Toby Zerner
2015-07-07 16:16:20 +09:30
parent 013d11554d
commit 4c5cf96b95
3 changed files with 20 additions and 13 deletions

View File

@@ -29,7 +29,7 @@ export default class DiscussionsSearchResults {
return m('li.discussion-search-result', {'data-index': 'discussions'+discussion.id()},
m('a', { href: app.route.discussion(discussion, post && post.number()), config: m.route },
m('div.title', highlight(discussion.title(), string)),
post ? m('div.excerpt', highlight(truncate(post.contentPlain(), 100), string)) : ''
post ? m('div.excerpt', highlight(post.contentPlain(), string, 100)) : ''
)
);
}) : ''