Very simple Swift wrapper of GitHub's fork of cmark. Uses a fork of cmark which has been adapted for building with SwiftPM.
let markdown = "# Hello"
let html = try markdownToHTML(markdown)
print(html) // This will return "<h1>Hello</h1>\n"
You can pass different options to the underlying cmark
library. By default safe
is passed, but this can be explicitly done with:
let html = try markdownToHTML(markdown, options: [.safe])
The available options are:
For more information on the available options, see cmark
.
.package(url: "https://github.com/vapor-community/markdown.git", .upToNextMajor(from: "0.4.0"))
link |
Stars: 50 |
Last commit: 2 years ago |
Full Changelog: https://github.com/vapor-community/markdown/compare/0.7.0...0.7.1
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics