mirror of
https://github.com/apricote/releaser-pleaser.git
synced 2026-01-13 21:21:03 +00:00
fix: no html escaping for changelog template (#277)
This commit is contained in:
parent
612928a382
commit
b0c50518b3
7 changed files with 37 additions and 24 deletions
|
|
@ -3,9 +3,9 @@ package changelog
|
|||
import (
|
||||
"bytes"
|
||||
_ "embed"
|
||||
"html/template"
|
||||
"log"
|
||||
"log/slog"
|
||||
"text/template"
|
||||
|
||||
"github.com/apricote/releaser-pleaser/internal/commitparser"
|
||||
"github.com/apricote/releaser-pleaser/internal/markdown"
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import (
|
|||
|
||||
"github.com/apricote/releaser-pleaser/internal/commitparser"
|
||||
"github.com/apricote/releaser-pleaser/internal/git"
|
||||
"github.com/apricote/releaser-pleaser/internal/testdata"
|
||||
)
|
||||
|
||||
func ptr[T any](input T) *T {
|
||||
|
|
@ -143,16 +144,9 @@ func Test_NewChangelogEntry(t *testing.T) {
|
|||
},
|
||||
version: "1.0.0",
|
||||
link: "https://example.com/1.0.0",
|
||||
prefix: "### Breaking Changes",
|
||||
prefix: testdata.MustReadFileString(t, "prefix.txt"),
|
||||
},
|
||||
want: `## [1.0.0](https://example.com/1.0.0)
|
||||
|
||||
### Breaking Changes
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- Foobar!
|
||||
`,
|
||||
want: testdata.MustReadFileString(t, "changelog-entry-prefix.txt"),
|
||||
wantErr: assert.NoError,
|
||||
},
|
||||
{
|
||||
|
|
@ -167,18 +161,9 @@ func Test_NewChangelogEntry(t *testing.T) {
|
|||
},
|
||||
version: "1.0.0",
|
||||
link: "https://example.com/1.0.0",
|
||||
suffix: "### Compatibility\n\nThis version is compatible with flux-compensator v2.2 - v2.9.",
|
||||
suffix: testdata.MustReadFileString(t, "suffix.txt"),
|
||||
},
|
||||
want: `## [1.0.0](https://example.com/1.0.0)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- Foobar!
|
||||
|
||||
### Compatibility
|
||||
|
||||
This version is compatible with flux-compensator v2.2 - v2.9.
|
||||
`,
|
||||
want: testdata.MustReadFileString(t, "changelog-entry-suffix.txt"),
|
||||
wantErr: assert.NoError,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue