Skip to content

Commit 5c29ff5

Browse files
committed
Refine NPM descriptions
1 parent 9451a5d commit 5c29ff5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/npm/search.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package npm
22

33
import (
44
"net/http"
5+
"strings"
56
"time"
67

78
"github.com/PuerkitoBio/goquery"
@@ -28,6 +29,8 @@ func SearchByScrape(name string) ([]model.NPMPackageResult, error) {
2829
description := section.Find("p").Text()
2930
if len(description) == 0 {
3031
description = model.NoDescription
32+
} else {
33+
description = strings.Trim(description, " \n\t")
3134
}
3235

3336
result = append(result, model.NPMPackageResult{

0 commit comments

Comments
 (0)