mirror of
https://github.com/flarum/core.git
synced 2025-07-28 20:20:34 +02:00
don't show excerpt if there are no plain content (#2964)
for https://github.com/flarum/core/issues/2942
This commit is contained in:
@@ -16,7 +16,8 @@ export default class PostPreview extends Component {
|
||||
view() {
|
||||
const post = this.attrs.post;
|
||||
const user = post.user();
|
||||
const excerpt = highlight(post.contentPlain(), this.attrs.highlight, 300);
|
||||
const content = post.contentType() === 'comment' && post.contentPlain();
|
||||
const excerpt = content ? highlight(content, this.attrs.highlight, 300) : '';
|
||||
|
||||
return (
|
||||
<Link className="PostPreview" href={app.route.post(post)} onclick={this.attrs.onclick}>
|
||||
|
Reference in New Issue
Block a user