Skip to content

Commit ccd4968

Browse files
committed
comrak: Adjust to API changes
The options structs are non-exhaustive now.
1 parent fb8c516 commit ccd4968

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

crates_io_markdown/lib.rs

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,21 @@ impl<'a> MarkdownRenderer<'a> {
6161
ComrakRenderOptions,
6262
};
6363

64+
let mut render_options = ComrakRenderOptions::default();
65+
// The output will be sanitized with `ammonia`
66+
render_options.unsafe_ = true;
67+
68+
let mut extension_options = ComrakExtensionOptions::default();
69+
extension_options.autolink = true;
70+
extension_options.strikethrough = true;
71+
extension_options.table = true;
72+
extension_options.tagfilter = true;
73+
extension_options.tasklist = true;
74+
extension_options.header_ids = Some("user-content-".to_string());
75+
6476
let options = ComrakOptions {
65-
render: ComrakRenderOptions {
66-
unsafe_: true, // The output will be sanitized with `ammonia`
67-
..ComrakRenderOptions::default()
68-
},
69-
extension: ComrakExtensionOptions {
70-
autolink: true,
71-
strikethrough: true,
72-
table: true,
73-
tagfilter: true,
74-
tasklist: true,
75-
header_ids: Some("user-content-".to_string()),
76-
..ComrakExtensionOptions::default()
77-
},
77+
render: render_options,
78+
extension: extension_options,
7879
..ComrakOptions::default()
7980
};
8081

0 commit comments

Comments
 (0)