vmg / sundown

Standards compliant, fast, secure markdown processing library in C
1.99k stars 385 forks source link

Sundown

Sundown is a Markdown parser based on the original code of the Upskirt library by Natacha Porté.

Features

Credits

Sundown is based on the original Upskirt parser by Natacha Porté, with many additions by Vicent Marti (@vmg) and contributions from the following authors:

Ben Noordhuis, Bruno Michel, Joseph Koshy, Krzysztof Kowalczyk, Samuel Bronson,
Shuhei Tanuma

Bindings

Sundown is available from other programming languages thanks to these bindings developed by our awesome contributors.

Help us

Sundown is all about security. If you find a (potential) security vulnerability in the library, or a way to make it crash through malicious input, please report it to us, either directly via email or by opening an Issue on GitHub, and help make the web safer for everybody.

Unicode character handling

Given that the Markdown spec makes no provision for Unicode character handling, Sundown takes a conservative approach towards deciding which extended characters trigger Markdown features:

Install

There is nothing to install. Sundown is composed of 3 .c files (markdown.c, buffer.c and array.c), so just throw them in your project. Zero-dependency means zero-dependency. You might want to include render/html.c if you want to use the included XHTML renderer, or write your own renderer. Either way, it's all fun and joy.

If you are hardcore, you can use the included Makefile to build Sundown into a dynamic library, or to build the sample sundown executable, which is just a commandline Markdown to XHTML parser. (If gcc gives you grief about -fPIC, e.g. with MinGW, try make MFLAGS= instead of just make.)

License

Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.