diff options
Diffstat (limited to 'src/posts/fs_post.rs')
-rw-r--r-- | src/posts/fs_post.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/posts/fs_post.rs b/src/posts/fs_post.rs index a1de678..12ce538 100644 --- a/src/posts/fs_post.rs +++ b/src/posts/fs_post.rs @@ -1,3 +1,5 @@ +use comrak::Options; + use crate::posts::abstractions::post::Post; use std::{borrow::Cow, fs, path::PathBuf}; @@ -19,14 +21,14 @@ impl Post for FsPost { fn get_article(&self) -> Cow<str> { let article = fs::read_to_string(&self.file).unwrap(); - Cow::Owned(article) + Cow::Owned(comrak::markdown_to_html(&article, &Options::default())) } fn get_description(&self) -> Cow<str> { let article = self.get_article(); Cow::Owned( article - .split_once("\n") + .split_once('\n') .map(|(first, _)| first) .unwrap_or_default() .trim_start_matches('_') |