diff options
| author | Anhgelus Morhtuuzh <william@herges.fr> | 2026-02-06 09:02:48 +0100 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <william@herges.fr> | 2026-02-06 09:02:48 +0100 |
| commit | 2350395bdc1afe135141bd8a2d08f63ec3c8d4cb (patch) | |
| tree | bb283c9e6c78b3b84be807cce9820ee998fede5f /markdown | |
| parent | 91083bbb6ecc47e2ece4cec0ddf7cb784a76f405 (diff) | |
feat(frontend): default color for unknown callout
Diffstat (limited to 'markdown')
| -rw-r--r-- | markdown/ast_callout.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/markdown/ast_callout.go b/markdown/ast_callout.go index 769d714..d538a09 100644 --- a/markdown/ast_callout.go +++ b/markdown/ast_callout.go @@ -40,9 +40,11 @@ func (a *astCallout) Eval(opt *Option) (template.HTML, *ParseError) { } title := dom.NewLiteralContentElement("h4", titleContent) - callout := dom.NewContentElement("div", make([]dom.Element, 2)) - callout.Contents[0] = title - callout.Contents[1] = inner + callout := dom.NewContentElement("div", make([]dom.Element, 0)) + callout.Contents = append(callout.Contents, title) + if len(inner.Contents) > 0 { + callout.Contents = append(callout.Contents, inner) + } callout.SetAttribute("data-kind", a.kind) callout.ClassList().Add("callout") return callout.Render(), nil |
