aboutsummaryrefslogtreecommitdiffstats
path: root/modules/markup/mdstripper/mdstripper.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/markup/mdstripper/mdstripper.go')
-rw-r--r--modules/markup/mdstripper/mdstripper.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/modules/markup/mdstripper/mdstripper.go b/modules/markup/mdstripper/mdstripper.go
index fe0eabb473..5a6504416a 100644
--- a/modules/markup/mdstripper/mdstripper.go
+++ b/modules/markup/mdstripper/mdstripper.go
@@ -46,7 +46,7 @@ func (r *stripRenderer) Render(w io.Writer, source []byte, doc ast.Node) error {
coalesce := prevSibIsText
r.processString(
w,
- v.Text(source), //nolint:staticcheck
+ v.Text(source), //nolint:staticcheck // Text is deprecated
coalesce)
if v.SoftLineBreak() {
r.doubleSpace(w)
@@ -91,8 +91,7 @@ func (r *stripRenderer) processAutoLink(w io.Writer, link []byte) {
}
// Note: we're not attempting to match the URL scheme (http/https)
- host := strings.ToLower(u.Host)
- if host != "" && host != strings.ToLower(r.localhost.Host) {
+ if u.Host != "" && !strings.EqualFold(u.Host, r.localhost.Host) {
// Process out of band
r.links = append(r.links, linkStr)
return
@@ -107,11 +106,12 @@ func (r *stripRenderer) processAutoLink(w io.Writer, link []byte) {
}
var sep string
- if parts[3] == "issues" {
+ switch parts[3] {
+ case "issues":
sep = "#"
- } else if parts[3] == "pulls" {
+ case "pulls":
sep = "!"
- } else {
+ default:
// Process out of band
r.links = append(r.links, linkStr)
return