Enable some extentions for the Markdown syntax

Enable the strikethrough, tagfilter, tasklist and autolink extensions
from the GFM spec.
This commit is contained in:
Paul van Tilburg 2017-12-30 13:46:57 +01:00
parent fe9a5f1f52
commit 51d3e876d6
1 changed files with 7 additions and 2 deletions

View File

@ -8,8 +8,13 @@ use std::time::SystemTime;
/// Converts raw string data (in Markdown format) to HTML
pub fn data_to_html(data: &String) -> String {
comrak::markdown_to_html(data,
&comrak::ComrakOptions::default())
let mut options = comrak::ComrakOptions::default();
options.ext_strikethrough = true;
options.ext_tagfilter = true;
options.ext_autolink = true;
options.ext_tasklist = true;
comrak::markdown_to_html(data, &options)
}
#[derive(Clone, Debug, Serialize, Deserialize)]