Skip to content

Commit e872d39

Browse files
committed
comrak: Use new builder() helpers
1 parent b30a1cd commit e872d39

File tree

1 file changed

+14
-12
lines changed
  • crates/crates_io_markdown

1 file changed

+14
-12
lines changed

crates/crates_io_markdown/lib.rs

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,20 @@ impl<'a> MarkdownRenderer<'a> {
7171
ComrakRenderOptions,
7272
};
7373

74-
let mut render_options = ComrakRenderOptions::default();
75-
// The output will be sanitized with `ammonia`
76-
render_options.unsafe_ = true;
77-
78-
let mut extension_options = ComrakExtensionOptions::default();
79-
extension_options.autolink = true;
80-
extension_options.strikethrough = true;
81-
extension_options.table = true;
82-
extension_options.tagfilter = true;
83-
extension_options.tasklist = true;
84-
extension_options.header_ids = Some("user-content-".to_string());
85-
extension_options.footnotes = true;
74+
let render_options = ComrakRenderOptions::builder()
75+
// The output will be sanitized with `ammonia`
76+
.unsafe_(true)
77+
.build();
78+
79+
let extension_options = ComrakExtensionOptions::builder()
80+
.autolink(true)
81+
.strikethrough(true)
82+
.table(true)
83+
.tagfilter(true)
84+
.tasklist(true)
85+
.header_ids("user-content-".to_string())
86+
.footnotes(true)
87+
.build();
8688

8789
let options = ComrakOptions {
8890
render: render_options,

0 commit comments

Comments
 (0)