Skip to content

Commit 48db29a

Browse files
authored
Merge pull request #7228 from rust-lang/renovate/comrak-0.x
Update Rust crate comrak to v0.19.0
2 parents 5210643 + ccd4968 commit 48db29a

File tree

3 files changed

+90
-16
lines changed

3 files changed

+90
-16
lines changed

Cargo.lock

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

crates_io_markdown/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ path = "lib.rs"
1111

1212
[dependencies]
1313
ammonia = "=3.3.0"
14-
comrak = { version = "=0.18.0", default-features = false }
14+
comrak = { version = "=0.19.0", default-features = false }
1515
htmlescape = "=0.3.1"
1616
url = "=2.4.1"

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)