Skip to content

Commit 603bd13

Browse files
jyn514Joshua Nelson
authored andcommitted
Update comrak
This removes 4 dependencies, including two duplicate copies of `syn` and `quote`. ``` $ cargo update -p comrak Updating crates.io index Updating comrak v0.3.1 -> v0.8.0 Removing pest v1.0.6 Removing pest_derive v1.0.8 Removing quote v0.3.15 Removing syn v0.11.11 Removing synom v0.11.3 Adding twoway v0.2.1 Adding unchecked-index v0.2.2 Removing unicode-xid v0.0.4 ``` - Remove `safe = true` This was made the default in 0.4.0. The field is now called `unsafe_`. https://github.com/kivikakk/comrak/blob/master/changelog.txt#L63
1 parent f16b4f6 commit 603bd13

File tree

3 files changed

+35
-67
lines changed

3 files changed

+35
-67
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ url = { version = "2.1.1", features = ["serde"] }
2525
badge = { path = "src/web/badge" }
2626
backtrace = "0.3"
2727
failure = { version = "0.1.3", features = ["backtrace"] }
28-
comrak = { version = "0.3", default-features = false }
28+
comrak = { version = "0.8", default-features = false }
2929
toml = "0.5"
3030
kuchiki = "0.8"
3131
schemamama = "0.3"

src/web/mod.rs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -369,17 +369,18 @@ fn match_version(conn: &Connection, name: &str, version: Option<&str>) -> Option
369369

370370
/// Wrapper around the Markdown parser and renderer to render markdown
371371
fn render_markdown(text: &str) -> String {
372-
use comrak::{markdown_to_html, ComrakOptions};
373-
374-
let options = {
375-
let mut options = ComrakOptions::default();
376-
options.safe = true;
377-
options.ext_superscript = true;
378-
options.ext_table = true;
379-
options.ext_autolink = true;
380-
options.ext_tasklist = true;
381-
options.ext_strikethrough = true;
382-
options
372+
use comrak::{markdown_to_html, ComrakExtensionOptions, ComrakOptions};
373+
374+
let options = ComrakOptions {
375+
extension: ComrakExtensionOptions {
376+
superscript: true,
377+
table: true,
378+
autolink: true,
379+
tasklist: true,
380+
strikethrough: true,
381+
..ComrakExtensionOptions::default()
382+
},
383+
..ComrakOptions::default()
383384
};
384385

385386
markdown_to_html(text, &options)

0 commit comments

Comments
 (0)