You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A 100% CommonMark-compatible GitHub Flavored Markdown parser and formatter
34
36
35
37
USAGE:
36
38
comrak [FLAGS] [OPTIONS] [--] [FILE]...
37
39
38
40
FLAGS:
39
-
--footnotes Parse footnotes
40
41
--github-pre-lang Use GitHub-style <pre lang> for code blocks
41
42
--hardbreaks Treat newlines as hard line breaks
42
43
-h, --help Prints help information
@@ -110,12 +111,14 @@ assert_eq!(
110
111
</ol>\n");
111
112
```
112
113
114
+
113
115
## Security
114
116
115
117
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.
116
118
117
119
You can also disable this potentially unsafe feature by using the `safe` option (or `--safe` at the command-line).
118
120
121
+
119
122
## Extensions
120
123
121
124
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
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 (_
145
149
146
150
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.
147
151
152
+
148
153
## Contributors
149
154
150
155
Thank you for PRs and issues opened!
@@ -164,6 +169,7 @@ Thank you for PRs and issues opened!
0 commit comments