Skip to content

Commit 1f222ad

Browse files
committed
Address changes to comrak configuration structs
1 parent 36e5e56 commit 1f222ad

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/render.rs

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,23 @@ impl<'a> MarkdownRenderer<'a> {
5757

5858
/// Renders the given markdown to HTML using the current settings.
5959
fn to_html(&self, text: &str) -> String {
60-
let options = comrak::ComrakOptions {
61-
unsafe_: true, // The output will be sanitized with `ammonia`
62-
ext_autolink: true,
63-
ext_strikethrough: true,
64-
ext_table: true,
65-
ext_tagfilter: true,
66-
ext_tasklist: true,
67-
ext_header_ids: Some("user-content-".to_string()),
68-
..comrak::ComrakOptions::default()
60+
use comrak::{ComrakExtensionOptions, ComrakOptions, ComrakRenderOptions};
61+
62+
let options = ComrakOptions {
63+
render: ComrakRenderOptions {
64+
unsafe_: true, // The output will be sanitized with `ammonia`
65+
..ComrakRenderOptions::default()
66+
},
67+
extension: ComrakExtensionOptions {
68+
autolink: true,
69+
strikethrough: true,
70+
table: true,
71+
tagfilter: true,
72+
tasklist: true,
73+
header_ids: Some("user-content-".to_string()),
74+
..ComrakExtensionOptions::default()
75+
},
76+
..ComrakOptions::default()
6977
};
7078
let rendered = comrak::markdown_to_html(text, &options);
7179
self.html_sanitizer.clean(&rendered).to_string()

0 commit comments

Comments
 (0)