-
-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
18 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "comrak" | ||
version = "0.2.14" | ||
version = "0.3.0" | ||
authors = ["Ashe Connor <[email protected]>"] | ||
description = "A 100% CommonMark-compatible GitHub Flavored Markdown parser and formatter" | ||
documentation = "https://docs.rs/comrak" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,30 +13,31 @@ Rust port of [github's `cmark-gfm`](https://github.com/github/cmark). | |
* [Contributors](#contributors) | ||
* [Legal](#legal) | ||
|
||
|
||
## Installation | ||
|
||
Specify it as a requirement in `Cargo.toml`: | ||
|
||
```toml | ||
[dependencies] | ||
comrak = "0.2" | ||
comrak = "0.3" | ||
``` | ||
|
||
|
||
## Usage | ||
|
||
A binary is included which does everything you typically want: | ||
|
||
``` | ||
$ comrak --help | ||
comrak 0.2.14 | ||
comrak 0.3.0 | ||
Ashe Connor <[email protected]> | ||
A 100% CommonMark-compatible GitHub Flavored Markdown parser and formatter | ||
USAGE: | ||
comrak [FLAGS] [OPTIONS] [--] [FILE]... | ||
FLAGS: | ||
--footnotes Parse footnotes | ||
--github-pre-lang Use GitHub-style <pre lang> for code blocks | ||
--hardbreaks Treat newlines as hard line breaks | ||
-h, --help Prints help information | ||
|
@@ -110,12 +111,14 @@ assert_eq!( | |
</ol>\n"); | ||
``` | ||
|
||
|
||
## Security | ||
|
||
As with [`cmark-gfm`](https://github.com/github/cmark#security), Comrak will pass through inline HTML, dangerous links, anything you can imagine — it only performs Markdown to HTML conversion per the CommonMark/GFM spec. We recommend the use of a sanitisation library like [`ammonia`](https://github.com/notriddle/ammonia) configured specific to your needs. | ||
|
||
You can also disable this potentially unsafe feature by using the `safe` option (or `--safe` at the command-line). | ||
|
||
|
||
## Extensions | ||
|
||
Comrak supports the five extensions to CommonMark defined in the | ||
|
@@ -133,6 +136,7 @@ By default none are enabled; they are individually enabled with each parse by | |
setting the appropriate values in the | ||
[`ComrakOptions` struct](https://docs.rs/comrak/newest/comrak/struct.ComrakOptions.html). | ||
|
||
|
||
## Related projects | ||
|
||
Comrak's design goal is to model the upstream [`cmark-gfm`](https://github.com/github/cmark) as closely as possible in terms of code structure. The upside of this is that a change in `cmark-gfm` has a very predictable change in Comrak. It helps that I maintain both, and tend to update Comrak in lock-step with `cmark-gfm`. Likewise, any bug in `cmark-gfm` is likely to be reproduced in Comrak. This could be considered a pro or a con, depending on your use case. | ||
|
@@ -145,6 +149,7 @@ The downside, of course, is that the code is not what I'd call idiomatic Rust (_ | |
|
||
As far as I know, Comrak is the only library to implement all of the [GitHub Flavored Markdown extensions](https://github.github.com/gfm) to the spec, but this tends to only be important if you want to reproduce GitHub's Markdown rendering exactly, e.g. in a GitHub client app. | ||
|
||
|
||
## Contributors | ||
|
||
Thank you for PRs and issues opened! | ||
|
@@ -164,6 +169,7 @@ Thank you for PRs and issues opened! | |
* [steveklabnik](https://github.com/steveklabnik) | ||
* [brson](https://github.com/brson) | ||
* [Keats](https://github.com/Keats) | ||
* [ayosec](https://github.com/ayosec) | ||
|
||
## Legal | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters