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

Change-Id: I839863a8c10c54fae11100b885c972bed348eba6
diff --git a/devtools/hackdoc/markdown.go b/devtools/hackdoc/markdown.go
index eaed905..cfd594d 100644
--- a/devtools/hackdoc/markdown.go
+++ b/devtools/hackdoc/markdown.go
@@ -19,6 +19,12 @@
 		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)