fix(readarr): stop appending stray colons to the edition overview

Every line of the edition details popup was parsed as a label and a value,
so a line carrying no colon had one appended to it. A multi-line overview
therefore rendered with a spurious colon at the end of each continuation
line, and Goodreads sourced descriptions, which use CRLF, turned their
blank lines into a lone colon.

Split each line on the first colon only, leave a line without one
unlabelled, and trim the trailing carriage return so a CRLF blank line
renders as a real paragraph break.

Building the line is now a named function so its branches can be asserted
directly. Rendered text discards the carriage return, so a snapshot alone
cannot tell the trimming apart from leaving it in place.

A continuation line that happens to contain a colon is still styled as a
label. Telling those apart needs the details to be built as styled lines
rather than flattened to text and parsed back.
This commit is contained in:
Dark-Alex-17 committed 2026-09-03 13:20:21 -06:00
1 parent 61a18cb222
commit a311e2b895
7 files changed
+103 -35

No files matched your search

+15 -11
View File
@@ -448,17 +448,21 @@ impl ReadarrData<'_> {
let edition_details_modal = EditionDetailsModal {
edition_details: ScrollableText::with_string(
"Title: Test Edition
Format: Hardcover
Language: English
Publisher: DAW Books
Page Count: 288
Release Date: 2023-05-20 00:00:00 UTC
ISBN13: 9780756404079
ASIN: B0043RSJ9S
Ratings: 4.5 (1000 votes)
Monitored: true
Overview: A test edition overview."
"Title: Test Edition\n\
Format: Hardcover\n\
Language: English\n\
Publisher: DAW Books\n\
Page Count: 288\n\
Release Date: 2023-05-20 00:00:00 UTC\n\
ISBN13: 9780756404079\n\
ASIN: B0043RSJ9S\n\
Ratings: 4.5 (1000 votes)\n\
Monitored: true\n\
Overview: original cover of ISBN 075640407X\r\n\
\r\n\
My name is Kvothe, pronounced nearly the same as \"quothe.\"\r\n\
\r\n\
The Adem call me Maedre: which means The Flame.\r\n"
.to_owned(),
),
};