Skip to content

Commit

Permalink
Merge pull request #6 from PRODYNA/5-remove-html-comment-from-changel…
Browse files Browse the repository at this point in the history
…og-description

Remove HTML comment
  • Loading branch information
dkrizic authored May 27, 2024
2 parents 390f734 + 3527cb8 commit e0022d3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ inputs:
default: 'true'
runs:
using: 'docker'
image: 'docker://ghcr.io/prodyna/changelog-json:v1.1'
image: 'docker://ghcr.io/prodyna/changelog-json:v1.2'
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
REPOSITORIES: ${{ inputs.repositories }}
Expand Down
4 changes: 4 additions & 0 deletions changelog/expand/expand.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,9 @@ func ExpandLinks(description string) string {
r = regexp.MustCompile("@(\\w+)")
description = r.ReplaceAllString(description, "[**@$1**](https://github.com/$1)")

// <!-- blabla --> -> ""
r = regexp.MustCompile("<!--.*?-->")
description = r.ReplaceAllString(description, "")

return description
}
5 changes: 5 additions & 0 deletions changelog/expand/expand_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ func TestExpandLinks(t *testing.T) {
description: "this is a github user @dkrizic",
want: "this is a github user [**@dkrizic**](https://github.com/dkrizic)",
},
{
name: "html comment",
description: "this is a html comment <!-- blabla --> after comment",
want: "this is a html comment after comment",
},
}

for _, tt := range tests {
Expand Down

0 comments on commit e0022d3

Please sign in to comment.