fix(render): Enable GFM's tagfilter extension

This commit is contained in:
Vincent Ambo 2018-04-16 03:15:50 +02:00
parent a5f2677785
commit 1462810963
2 changed files with 2 additions and 2 deletions

View file

@ -146,6 +146,7 @@ fn start_renderer() -> Addr<Syn, Renderer> {
ext_autolink: true, ext_autolink: true,
ext_tasklist: true, ext_tasklist: true,
ext_footnotes: true, ext_footnotes: true,
ext_tagfilter: true,
..Default::default() ..Default::default()
}; };

View file

@ -118,14 +118,13 @@ fn prepare_thread(comrak: &ComrakOptions, page: ThreadPage) -> RenderableThreadP
let user = page.current_user; let user = page.current_user;
let posts = page.posts.into_iter().map(|post| { let posts = page.posts.into_iter().map(|post| {
let escaped_body = escape_html(&post.body);
let editable = user.clone() let editable = user.clone()
.map(|c| post.author_email.eq(&c)) .map(|c| post.author_email.eq(&c))
.unwrap_or_else(|| false); .unwrap_or_else(|| false);
RenderablePost { RenderablePost {
id: post.id, id: post.id,
body: markdown_to_html(&escaped_body, comrak), body: markdown_to_html(&post.body, comrak),
posted: post.posted.into(), posted: post.posted.into(),
author_name: post.author_name.clone(), author_name: post.author_name.clone(),
author_gravatar: md5_hex(post.author_email.as_bytes()), author_gravatar: md5_hex(post.author_email.as_bytes()),