Browse Source

Fix markdown anchor links (#9673)

Co-authored-by: Lauris BH <lauris@nix.lv>
tags/v1.12.0-dev
Moritz Antoine GIRARD 5 years ago
parent
commit
e9a5e92d04
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      modules/markup/markdown/goldmark.go

+ 3
- 0
modules/markup/markdown/goldmark.go 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


Loading…
Cancel
Save