Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Standards compliant, fast, secure markdown processing library in C

NotificationsYou must be signed in to change notification settings

vmg/sundown

Repository files navigation

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

Features

  • Fully standards compliant

    Sundown passes out of the box the official Markdown v1.0.0 and v1.0.3test suites, and has been extensively tested with additional corner casesto make sure its output is as sane as possible at all times.

  • Massive extension support

    Sundown has optional support for several (unofficial) Markdown extensions,such as non-strict emphasis, fenced code blocks, tables, autolinks,strikethrough and more.

  • UTF-8 aware

    Sundown is fully UTF-8 aware, both when parsing the source document and whengenerating the resulting (X)HTML code.

  • Tested & Ready to be used on production

    Sundown has been extensively security audited, and includes protection againstall possible DOS attacks (stack overflows, out of memory situations, malformedMarkdown syntax...) and against client attacks through malicious embedded HTML.

    We've worked very hard to makeSundown never crash or run out of memoryunderany input.Sundown renders all the Markdown content in GitHub and sofar hasn't crashed a single time.

  • Customizable renderers

    Sundown is not stuck with XHTML output: the Markdown parser of the libraryis decoupled from the renderer, so it's trivial to extend the library withcustom renderers. A fully functional (X)HTML renderer is included.

  • Optimized for speed

    Sundown is written in C, with a special emphasis on performance. When wrappedon a dynamic language such as Python or Ruby, it has shown to be up to 40times faster than other native alternatives.

  • Zero-dependency

    Sundown is a zero-dependency library composed of 3.c files and their headers.No dependencies, no bullshit. Only standard C99 that builds everywhere.

Credits

Sundown is based on the original Upskirt parser by Natacha Porté, with many additionsby 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 developedby our awesome contributors.

Help us

Sundown is all about security. If you find a (potential) security vulnerability in thelibrary, 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 saferfor everybody.

Unicode character handling

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

  • Punctuation characters outside of the U+007F codepoint are not handled as punctuation.They are considered as normal, in-word characters for word-boundary checks.

  • Whitespace characters outside of the U+007F codepoint are not considered aswhitespace. They are considered as normal, in-word characters for word-boundary checks.

Install

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

If you are hardcore, you can use the includedMakefile to buildSundown into a dynamiclibrary, or to build the samplesundown executable, which is just a commandlineMarkdown to XHTML parser. (If gcc gives you grief about-fPIC, e.g. with MinGW, trymake MFLAGS= instead of justmake.)

License

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

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

About

Standards compliant, fast, secure markdown processing library in C

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp