mirror of
https://github.com/flarum/core.git
synced 2025-07-29 12:40:40 +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() {
|
view() {
|
||||||
const post = this.attrs.post;
|
const post = this.attrs.post;
|
||||||
const user = post.user();
|
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 (
|
return (
|
||||||
<Link className="PostPreview" href={app.route.post(post)} onclick={this.attrs.onclick}>
|
<Link className="PostPreview" href={app.route.post(post)} onclick={this.attrs.onclick}>
|
||||||
|
Reference in New Issue
Block a user