Add Markdown->HTML parsing
This commit is contained in:
parent
62ced34964
commit
06996ee903
1 changed files with 11 additions and 0 deletions
|
@ -68,6 +68,17 @@ pub mod markdown {
|
||||||
renderer.extract()
|
renderer.extract()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn to_html(self) -> String {
|
||||||
|
use hoedown::renderer::html::Html;
|
||||||
|
use hoedown::renderer::html;
|
||||||
|
|
||||||
|
String::from(
|
||||||
|
Html::new(html::Flags::empty(), 0)
|
||||||
|
.render(&self.text)
|
||||||
|
.to_str()
|
||||||
|
.unwrap_or("UTF8Error"))
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue