summaryrefslogtreecommitdiff
path: root/html/highlight.go
diff options
context:
space:
mode:
authora73x <[email protected]>2024-09-04 09:30:23 +0100
committera73x <[email protected]>2024-09-04 09:30:23 +0100
commit3d6d3fe9344c588dba734ee155b5f08b87840e43 (patch)
tree03a91111552576164f38d3cbc81977bed4b32c50 /html/highlight.go
parentcdc0dec8a66d94463a3968a72b90bb4e2ec1c170 (diff)
feat(html): add toc + footnotes
Diffstat (limited to 'html/highlight.go')
-rw-r--r--html/highlight.go7
1 files changed, 2 insertions, 5 deletions
diff --git a/html/highlight.go b/html/highlight.go
index 7f520ed..087e043 100644
--- a/html/highlight.go
+++ b/html/highlight.go
@@ -1,7 +1,6 @@
package html
import (
- "fmt"
"io"
"github.com/gomarkdown/markdown/ast"
@@ -58,15 +57,13 @@ func newRenderer() *mdhtml.Renderer {
styleName := "monokailight"
highlightStyle := styles.Get(styleName)
- if highlightStyle == nil {
- panic(fmt.Sprintf("didn't find style '%s'", styleName))
- }
+
h := Highlighter{
htmlFormatter: htmlFormatter,
highlightStyle: highlightStyle,
}
opts := mdhtml.RendererOptions{
- Flags: mdhtml.CommonFlags,
+ Flags: mdhtml.CommonFlags | mdhtml.TOC | mdhtml.FootnoteReturnLinks,
RenderNodeHook: h.myRenderHook,
}
return mdhtml.NewRenderer(opts)