Move the convert_to_html code back into to_html of the list again

The module function was never used outside of the context of a list
anymore.
This commit is contained in:
Paul van Tilburg 2018-01-01 21:12:22 +01:00
parent 810d087508
commit d167c50918
1 changed files with 7 additions and 12 deletions

View File

@ -6,17 +6,6 @@ use std::io::prelude::*;
use std::path::PathBuf;
use std::time::SystemTime;
/// Converts raw string data (in Markdown format) to HTML
pub fn data_to_html(data: &String) -> String {
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)]
/// Structure for representing a wish list
pub struct List {
@ -36,7 +25,13 @@ pub struct List {
impl List {
pub fn to_html(&self) -> String {
data_to_html(&self.data)
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(&self.data, &options)
}
pub fn update_data(&mut self, data : &String) {