📃 Markdown renderer.
24 Commits
Eduard Urbach 809b89d689
Implemented image links
2024-04-03 21:13:59 +02:00
testdata Improved performance 2024-04-02 10:44:47 +02:00
.gitignore Initial commit 2024-03-31 21:01:47 +02:00
benchmarks_test.go Improved benchmark 2024-04-02 20:24:31 +02:00
go.mod Initial commit 2024-03-31 21:01:47 +02:00
go.sum Initial commit 2024-03-31 21:01:47 +02:00
README.md Implemented image links 2024-04-03 21:13:59 +02:00
Render_test.go Implemented image links 2024-04-03 21:13:59 +02:00
Render.go Implemented image links 2024-04-03 21:13:59 +02:00

markdown

A markdown renderer that supports only a subset of the CommonMark spec in order to make the rendering more efficient and the syntax more consistent.

Features

  • Bold
  • Code
  • Italic
  • Links
  • Lists
  • Images
  • Headers
  • Paragraphs
  • Quotes
  • Separators
  • Strikethrough
  • Tables

Installation

go get git.akyoto.dev/go/markdown

Usage

html := markdown.Render("# Header")

Tests

PASS: TestEmpty
PASS: TestParagraph
PASS: TestHeader
PASS: TestItalic
PASS: TestBold
PASS: TestStrike
PASS: TestLink
PASS: TestImage
PASS: TestList
PASS: TestTables
PASS: TestCode
PASS: TestQuote
PASS: TestSeparator
PASS: TestCombined
PASS: TestSecurity
coverage: 100.0% of statements

Benchmarks

BenchmarkSmall-12        5884641               201.5 ns/op            32 B/op          1 allocs/op
BenchmarkMedium-12        938371              1124 ns/op             512 B/op          1 allocs/op
BenchmarkLarge-12         277065              4115 ns/op            2560 B/op          2 allocs/op

License

Please see the license documentation.

© 2024 Eduard Urbach