summaryrefslogtreecommitdiff
path: root/src/html.rs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2022-07-31 10:55:11 +0300
committerLars Wirzenius <liw@liw.fi>2022-07-31 10:55:11 +0300
commitb51e5bf01794732b61b9402eceabce457f2120c9 (patch)
tree0ff64d37f06b455abe2a156f14af95b81bf6524a /src/html.rs
parentbc9493725346d909c305fcaacd06c448e303cd05 (diff)
downloadriki-b51e5bf01794732b61b9402eceabce457f2120c9.tar.gz
refactor: allow HTML generation to produce fatal errors
It doesn't, yet, but will need to, eventually. Sponsored-by: author
Diffstat (limited to 'src/html.rs')
-rw-r--r--src/html.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/html.rs b/src/html.rs
index b4e4c45..90bf9d5 100644
--- a/src/html.rs
+++ b/src/html.rs
@@ -60,7 +60,7 @@ impl HtmlPage {
}
}
-pub fn parse(markdown: &str) -> Element {
+pub fn parse(markdown: &str) -> Result<Element, SiteError> {
let mut options = Options::empty();
options.insert(Options::ENABLE_HEADING_ATTRIBUTES);
options.insert(Options::ENABLE_STRIKETHROUGH);
@@ -179,7 +179,7 @@ pub fn parse(markdown: &str) -> Element {
let mut body = stack.pop();
assert!(stack.is_empty());
body.fix_up_img_alt();
- body
+ Ok(body)
}
fn as_plain_text(content: &[Content]) -> String {