Skip to content

Commit

Permalink
Update comrak
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jyn514 authored and Joshua Nelson committed Aug 3, 2020
1 parent f16b4f6 commit 603bd13
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 67 deletions.
77 changes: 22 additions & 55 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ url = { version = "2.1.1", features = ["serde"] }
badge = { path = "src/web/badge" }
backtrace = "0.3"
failure = { version = "0.1.3", features = ["backtrace"] }
comrak = { version = "0.3", default-features = false }
comrak = { version = "0.8", default-features = false }
toml = "0.5"
kuchiki = "0.8"
schemamama = "0.3"
Expand Down
23 changes: 12 additions & 11 deletions src/web/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,17 +369,18 @@ fn match_version(conn: &Connection, name: &str, version: Option<&str>) -> Option

/// Wrapper around the Markdown parser and renderer to render markdown
fn render_markdown(text: &str) -> String {
use comrak::{markdown_to_html, ComrakOptions};

let options = {
let mut options = ComrakOptions::default();
options.safe = true;
options.ext_superscript = true;
options.ext_table = true;
options.ext_autolink = true;
options.ext_tasklist = true;
options.ext_strikethrough = true;
options
use comrak::{markdown_to_html, ComrakExtensionOptions, ComrakOptions};

let options = ComrakOptions {
extension: ComrakExtensionOptions {
superscript: true,
table: true,
autolink: true,
tasklist: true,
strikethrough: true,
..ComrakExtensionOptions::default()
},
..ComrakOptions::default()
};

markdown_to_html(text, &options)
Expand Down

0 comments on commit 603bd13

Please sign in to comment.