1
1
mirror of https://github.com/go-gitea/gitea synced 2024-12-25 01:54:26 +00:00

Fix markdown anchor links (#9673) (#9840)

This commit is contained in:
Moritz 2020-01-17 17:49:50 +01:00 committed by techknowlogick
parent fe46185407
commit b577500a54

View File

@ -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