Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion asset/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ h1, h2, h3, h4, h5, h6 {
.blog-post {
margin-bottom: 3rem;
}

.blog-post br + br {
display: none;
}

.blog-post-title {
margin-bottom: .25rem;
font-size: 2.5rem;
Expand All @@ -104,4 +109,4 @@ h1, h2, h3, h4, h5, h6 {

.markdown-body {
font-family: inherit;
}
}
12 changes: 10 additions & 2 deletions modules/posts/post/post.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ angular
bindings: {
post: '=',
},
controller: function ($sce, PostRepository, $q) {
controller: function ($sce, PostRepository, $q, $routeParams) {
this.commentsLoaded = false
this.showSpinner = true
this.loadComments = () => {
Expand All @@ -22,8 +22,16 @@ angular
this.dislikesCount = result.thumbDown
});

this.post.body = $sce.trustAsHtml(this.post.body)
const shortDescription = this.post.body.substring(0, this.post.body.indexOf('<hr>'))

if ($routeParams && $routeParams.id) {
this.post.body = $sce.trustAsHtml(this.post.body)
} else {
this.post.body = $sce.trustAsHtml(shortDescription || this.post.body)
}

this.showSpinner = false

};
}
})
Expand Down