Skip to content

Commit 2944c99

Browse files
fix(utils): update process verse
1 parent 8c83801 commit 2944c99

3 files changed

Lines changed: 9 additions & 5 deletions

File tree

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require (
66
github.com/bokwoon95/wgo v0.5.13
77
github.com/golangci/golangci-lint v1.64.8
88
github.com/samber/lo v1.51.0
9-
github.com/v-bible/protobuf/pkg/proto v0.6.0
9+
github.com/v-bible/protobuf/pkg/proto v0.6.1
1010
github.com/yuin/goldmark v1.7.13
1111
golang.org/x/exp v0.0.0-20250718183923-645b1fa84792
1212
golang.org/x/tools v0.35.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,8 +572,8 @@ github.com/uudashr/gocognit v1.2.0 h1:3BU9aMr1xbhPlvJLSydKwdLN3tEUUrzPSSM8S4hDYR
572572
github.com/uudashr/gocognit v1.2.0/go.mod h1:k/DdKPI6XBZO1q7HgoV2juESI2/Ofj9AcHPZhBBdrTU=
573573
github.com/uudashr/iface v1.3.1 h1:bA51vmVx1UIhiIsQFSNq6GZ6VPTk3WNMZgRiCe9R29U=
574574
github.com/uudashr/iface v1.3.1/go.mod h1:4QvspiRd3JLPAEXBQ9AiZpLbJlrWWgRChOKDJEuQTdg=
575-
github.com/v-bible/protobuf/pkg/proto v0.6.0 h1:B1A15uQ8HX0VhzvIygD64PI+zXlewP+cLP78e0MLAEg=
576-
github.com/v-bible/protobuf/pkg/proto v0.6.0/go.mod h1:Jc3cRxdEMt2bamN6jNZUwoXUBcHa8wBoUSLfzrQ0k0M=
575+
github.com/v-bible/protobuf/pkg/proto v0.6.1 h1:izQc3ZdmZv1eEdFTYE491IF8jQWR6/pc6LzRfvtLPfs=
576+
github.com/v-bible/protobuf/pkg/proto v0.6.1/go.mod h1:Jc3cRxdEMt2bamN6jNZUwoXUBcHa8wBoUSLfzrQ0k0M=
577577
github.com/xen0n/gosmopolitan v1.2.2 h1:/p2KTnMzwRexIW8GlKawsTWOxn7UHA+jCMF/V8HHtvU=
578578
github.com/xen0n/gosmopolitan v1.2.2/go.mod h1:7XX7Mj61uLYrj0qmeN0zi7XDon9JRAEhYQqAPLVNTeg=
579579
github.com/yagipy/maintidx v1.0.0 h1:h5NvIsCz+nRDapQ0exNv4aJ0yXSI0420omVANTv3GJM=

pkg/utils/process-verse.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,13 @@ func ProcessVerseMd(verses []*biblev1.Verse, footnotes []*biblev1.Footnote, head
103103
newContent = "\n> " + newContent + "\n>"
104104
}
105105

106+
slices.Reverse(psalms)
107+
106108
// NOTE: Add the Psalm title to the first verse
107109
if verse.SubVerseIndex == 0 && verse.ParagraphNumber == 0 {
108110
for _, psalm := range psalms {
109111
if psalm.ChapterId == verse.ChapterId {
110-
newContent = fmt.Sprintf("*%s*", psalm.Title) + "\n" + newContent
112+
newContent = fmt.Sprintf("*%s*", psalm.Text) + "\n" + newContent
111113
}
112114
}
113115
}
@@ -243,11 +245,13 @@ func ProcessVerseHtml(verses []*biblev1.Verse, footnotes []*biblev1.Footnote, he
243245
newContent = "\n<blockquote>" + newContent + "</blockquote>\n"
244246
}
245247

248+
slices.Reverse(psalms)
249+
246250
// NOTE: Add the Psalm title to the first verse
247251
if verse.SubVerseIndex == 0 && verse.ParagraphNumber == 0 {
248252
for _, psalm := range psalms {
249253
if psalm.ChapterId == verse.ChapterId {
250-
newContent = fmt.Sprintf("<i>%s</i>", regexp.MustCompile(`<p>|<\/p>\n?`).ReplaceAllString(mdToHTML(psalm.Title), "")) + "\n" + newContent
254+
newContent = fmt.Sprintf("<i>%s</i>", regexp.MustCompile(`<p>|<\/p>\n?`).ReplaceAllString(mdToHTML(psalm.Text), "")) + "\n" + newContent
251255
}
252256
}
253257
}

0 commit comments

Comments
 (0)