diff options
Diffstat (limited to 'internal/bible/booktable.go')
| -rw-r--r-- | internal/bible/booktable.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/internal/bible/booktable.go b/internal/bible/booktable.go index 360f526..2d4b5b2 100644 --- a/internal/bible/booktable.go +++ b/internal/bible/booktable.go @@ -216,6 +216,21 @@ func (t *BookTable) FormatRef(dialect, canonicalRef string) string { if g == "" { continue } + if cm := crossChapRangeRe.FindStringSubmatch(g); cm != nil { + // "M-P:Q": a range crossing a chapter boundary. Keep it intact -- + // it already reads naturally as "<chap>:M-P:Q" -- rather than + // peeling a fake newChap off the "P:" embedded inside it. + switch { + case i == 0: + b.WriteString(chapVerse(dialect, chap, g)) + case dialect == "pl": + b.WriteString(". " + g) + default: + b.WriteString("," + g) + } + chap = cm[2] // later groups (if any) belong to chapter P + continue + } newChap := "" if idx := strings.IndexByte(g, ':'); idx >= 0 { newChap, g = g[:idx], g[idx+1:] |
