mirror of
https://github.com/apricote/releaser-pleaser.git
synced 2026-02-07 18:27:03 +00:00
parent
36a0b90bcd
commit
2effe5e72d
12 changed files with 420 additions and 40 deletions
|
|
@ -39,7 +39,7 @@ func Format(input string) (string, error) {
|
|||
return buf.String(), nil
|
||||
}
|
||||
|
||||
func GetCodeBlockText(source []byte, language string, output *string) gast.Walker {
|
||||
func GetCodeBlockText(source []byte, language string, output *string, found *bool) gast.Walker {
|
||||
return func(n gast.Node, entering bool) (gast.WalkStatus, error) {
|
||||
if !entering {
|
||||
return gast.WalkContinue, nil
|
||||
|
|
@ -56,6 +56,9 @@ func GetCodeBlockText(source []byte, language string, output *string) gast.Walke
|
|||
}
|
||||
|
||||
*output = textFromLines(source, codeBlock)
|
||||
if found != nil {
|
||||
*found = true
|
||||
}
|
||||
// Stop looking after we find the first result
|
||||
return gast.WalkStop, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue