hackdoc: do not add ?ref= to intra-links unless necessary

Change-Id: I839863a8c10c54fae11100b885c972bed348eba6
changes/41/441/1
q3k 2020-09-23 18:12:11 +00:00
parent 242ec58a33
commit 26f44da5f1
1 changed files with 6 additions and 0 deletions

View File

@ -19,6 +19,12 @@ func renderMarkdown(input []byte, ref string) []byte {
Flags: blackfriday.CommonHTMLFlags | blackfriday.TOC,
})
// master is the default branch - do not make special links for that, as
// that makes them kinda ugly.
if ref == "master" {
ref = ""
}
parser := blackfriday.New(blackfriday.WithRenderer(r), blackfriday.WithExtensions(blackfriday.CommonExtensions))
ast := parser.Parse(input)