summaryrefslogtreecommitdiffstats
path: root/markup/highlight
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2022-02-26 17:24:10 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2022-02-26 21:54:36 +0100
commit579ff9b6524ed4e55c191ab94251f5a2fe315f68 (patch)
tree0249f3ae723241c4cc2fef7e9ad9ddf06e4bc523 /markup/highlight
parent928a89696273b1a5defa0e85115c9bd0e167cbf0 (diff)
markup/goldmark: Improve attributes vs options
Fixes #9571
Diffstat (limited to 'markup/highlight')
-rw-r--r--markup/highlight/highlight.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/markup/highlight/highlight.go b/markup/highlight/highlight.go
index 156007d0a..dac45e312 100644
--- a/markup/highlight/highlight.go
+++ b/markup/highlight/highlight.go
@@ -61,6 +61,7 @@ type Highlighter interface {
Highlight(code, lang string, opts interface{}) (string, error)
HighlightCodeBlock(ctx hooks.CodeblockContext, opts interface{}) (HightlightResult, error)
hooks.CodeBlockRenderer
+ hooks.IsDefaultCodeBlockRendererProvider
}
type chromaHighlighter struct {
@@ -129,6 +130,10 @@ func (h chromaHighlighter) RenderCodeblock(w hugio.FlexiWriter, ctx hooks.Codebl
return highlight(w, code, ctx.Lang(), attributes, cfg)
}
+func (h chromaHighlighter) IsDefaultCodeBlockRenderer() bool {
+ return true
+}
+
var id = identity.NewPathIdentity("chroma", "highlight")
func (h chromaHighlighter) GetIdentity() identity.Identity {