Skip to content

Commit f740943

Browse files
mohe2015lafriks
authored andcommitted
Fix markdown anchor links (#9673)
Co-authored-by: Lauris BH <[email protected]>
1 parent c6a32dd commit f740943

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

modules/markup/markdown/goldmark.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ func (g *GiteaASTTransformer) Transform(node *ast.Document, reader text.Reader,
7979
}
8080
link = []byte(giteautil.URLJoin(pc.Get(urlPrefixKey).(string), lnk))
8181
}
82+
if len(link) > 0 && link[0] == '#' {
83+
link = []byte("#user-content-" + string(link)[1:])
84+
}
8285
v.Destination = link
8386
}
8487
return ast.WalkContinue, nil

0 commit comments

Comments
 (0)