浏览代码

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

tags/v1.11.0-rc2
Moritz 4 年前
父节点
当前提交
b577500a54
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3
    0
      modules/markup/markdown/goldmark.go

+ 3
- 0
modules/markup/markdown/goldmark.go 查看文件

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

正在加载...
取消
保存