fix: Panic on empty link

This commit is contained in:
Manuel Rüger
2025-11-28 14:33:32 +01:00
parent a7390d8b33
commit 888d5de655
3 changed files with 6 additions and 1 deletions

View File

@@ -26,7 +26,7 @@ func (r *ConfluenceLinkRenderer) RegisterFuncs(reg renderer.NodeRendererFuncRegi
// renderLink renders links specifically for confluence
func (r *ConfluenceLinkRenderer) renderLink(writer util.BufWriter, source []byte, node ast.Node, entering bool) (ast.WalkStatus, error) {
n := node.(*ast.Link)
if string(n.Destination[0:3]) == "ac:" {
if len(n.Destination) >= 3 && string(n.Destination[0:3]) == "ac:" {
if entering {
_, err := writer.Write([]byte("<ac:link><ri:page ri:content-title=\""))
if err != nil {