mirror of
https://github.com/flarum/framework.git
synced 2024-11-28 11:34:36 +08: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:
parent
d8c112088d
commit
b32496d30c
|
@ -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}>
|
||||
|
|
Loading…
Reference in New Issue
Block a user