Fix issue with blog preview when content under 1000 chars.
This commit is contained in:
parent
3a8aedd653
commit
0f64014b30
6 changed files with 38 additions and 10 deletions
|
@ -5,9 +5,6 @@ namespace Website.ViewModels
|
|||
{
|
||||
public class BlogPostPreviewViewModel:BlogPostViewModel
|
||||
{
|
||||
public BlogPostPreviewViewModel(BlogPost blogPost):base(blogPost)
|
||||
{
|
||||
Content = Markdown.ToHtml(blogPost.Content.Substring(0, 1000), GetPipeline()).Trim();
|
||||
}
|
||||
public BlogPostPreviewViewModel(BlogPost blogPost) : base(blogPost) => Content = Content.Length < 1000 ? Content : Content.Substring(0, 1000);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue