Skip to content

Commit 389bd74

Browse files
committed
comrak: Adjust to new options APIs
1 parent 065fa84 commit 389bd74

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

src/posts.rs

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use super::blogs::Manifest;
2-
use comrak::{ComrakExtensionOptions, ComrakOptions, ComrakRenderOptions};
32
use regex::Regex;
43
use serde_derive::{Deserialize, Serialize};
54
use std::path::{Path, PathBuf};
@@ -68,18 +67,14 @@ impl Post {
6867
layout,
6968
} = serde_yaml::from_str(yaml)?;
7069
// next, the contents. we add + to get rid of the final "---\n\n"
71-
let options = ComrakOptions {
72-
render: ComrakRenderOptions {
73-
unsafe_: true, // Allow rendering of raw HTML
74-
..ComrakRenderOptions::default()
75-
},
76-
extension: ComrakExtensionOptions {
77-
header_ids: Some(String::new()),
78-
footnotes: true,
79-
table: true,
80-
..ComrakExtensionOptions::default()
81-
},
82-
..ComrakOptions::default()
70+
let options = comrak::Options {
71+
render: comrak::RenderOptionsBuilder::default().unsafe_(true).build()?,
72+
extension: comrak::ExtensionOptionsBuilder::default()
73+
.header_ids(Some(String::new()))
74+
.footnotes(true)
75+
.table(true)
76+
.build()?,
77+
..comrak::Options::default()
8378
};
8479

8580
// Content starts after "---\n" (we don't assume an extra newline)

0 commit comments

Comments
 (0)