mirror of
https://github.com/go-gitea/gitea
synced 2024-11-24 22:52:47 +01:00
Fix markdown anchor links (#9673)
Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
parent
c6a32ddb47
commit
f740943df4
1 changed files with 3 additions and 0 deletions
|
@ -79,6 +79,9 @@ func (g *GiteaASTTransformer) Transform(node *ast.Document, reader text.Reader,
|
|||
}
|
||||
link = []byte(giteautil.URLJoin(pc.Get(urlPrefixKey).(string), lnk))
|
||||
}
|
||||
if len(link) > 0 && link[0] == '#' {
|
||||
link = []byte("#user-content-" + string(link)[1:])
|
||||
}
|
||||
v.Destination = link
|
||||
}
|
||||
return ast.WalkContinue, nil
|
||||
|
|
Loading…
Reference in a new issue