From 9ec2c438a39542ec485e221d485c43b04d692aca Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Thu, 23 Jul 2026 23:28:15 +0200 Subject: tui: fix width-wrap garbling + straight-aligned verse column (export render.Wrap, hanging indent); strip niedziela summary subtitle (tui/cli/web); web verse grid alignment; refrain-italic pl-only --- internal/render/render.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'internal/render') diff --git a/internal/render/render.go b/internal/render/render.go index 265ed18..8a36f12 100644 --- a/internal/render/render.go +++ b/internal/render/render.go @@ -271,7 +271,7 @@ func compareSection(sec liturgy.Section, versions []string, width int, lectionar label, blocks := GatherVersion(v, sec, lectionary, lang) var lines []string for _, b := range blocks { - lines = append(lines, strings.Split(wrap(b, w), "\n")...) + lines = append(lines, strings.Split(Wrap(b, w), "\n")...) lines = append(lines, "") } if len(lines) > 0 { @@ -313,7 +313,10 @@ func compareSection(sec liturgy.Section, versions []string, width int, lectionar // line and never splitting a word (even one longer than width), matching // ewangelia.py's textwrap.fill(..., break_long_words=False, // break_on_hyphens=False). -func wrap(line string, width int) string { +// Wrap greedily word-wraps line to width without padding (each output line is +// at most width runes, no trailing spaces), never splitting a word. Shared by +// the CLI, the TUI reader and Compare so all three wrap identically. +func Wrap(line string, width int) string { words := strings.Fields(line) if len(words) == 0 { return "" -- cgit v1.3