From 3144be5c8118efa32c1367a00d7bd0602429c48b Mon Sep 17 00:00:00 2001 From: Unknwon Date: Thu, 23 Mar 2017 20:23:23 -0400 Subject: repo: remove legacy sanitizer for repository description Related to #4329. --- models/repo.go | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'models') diff --git a/models/repo.go b/models/repo.go index 0eb79577..3a661058 100644 --- a/models/repo.go +++ b/models/repo.go @@ -7,13 +7,11 @@ package models import ( "bytes" "fmt" - "html/template" "io/ioutil" "os" "os/exec" "path" "path/filepath" - "regexp" "sort" "strings" "time" @@ -493,18 +491,6 @@ func (repo *Repository) NextIssueIndex() int64 { return int64(repo.NumIssues+repo.NumPulls) + 1 } -var ( - DescPattern = regexp.MustCompile(`https?://\S+`) -) - -// DescriptionHtml does special handles to description and return HTML string. -func (repo *Repository) DescriptionHtml() template.HTML { - sanitize := func(s string) string { - return fmt.Sprintf(`%[1]s`, s) - } - return template.HTML(DescPattern.ReplaceAllStringFunc(markdown.Sanitizer.Sanitize(repo.Description), sanitize)) -} - func (repo *Repository) LocalCopyPath() string { return path.Join(setting.AppDataPath, "tmp/local-repo", com.ToStr(repo.ID)) } -- cgit v1.2.3