Skip to content
This repository was archived by the owner on Jun 1, 2022. It is now read-only.

Commit 3a53ead

Browse files
Add sweep markdown (HTML Style) comment in issue description
1 parent 6c20a76 commit 3a53ead

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

commands/internal/internal.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
package internal
22

3+
import "regexp"
4+
35
type Method interface {
46
Process() (string, error)
57
}
8+
9+
func SweepMarkdownComment(text string) string {
10+
r := regexp.MustCompile("<!--[\\s\\S]*?-->[\\n]*")
11+
return r.ReplaceAllString(text, "")
12+
}

commands/issue/detail.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Labels: %s
7676
issue.Assignee.Name,
7777
issue.Milestone.Title,
7878
strings.Join(issue.Labels, ", "),
79-
issue.Description,
79+
internal.SweepMarkdownComment(issue.Description),
8080
)
8181
return detial
8282
}
@@ -92,6 +92,6 @@ func noteOutput(note *gitlab.Note) string {
9292
yellow(fmt.Sprintf("comment %d", note.ID)),
9393
note.Author.Name,
9494
note.CreatedAt.String(),
95-
note.Body,
95+
internal.SweepMarkdownComment(note.Body),
9696
)
9797
}

0 commit comments

Comments
 (0)