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:
7 files changed
+103
-35
No files matched your search
+3
-3
@@ -19,11 +19,11 @@ expression: output
|
||||
│ │ASIN: B0043RSJ9S │ │
|
||||
│ │Ratings: 4.5 (1000 votes) │ │
|
||||
│ │Monitored: true │ │
|
||||
│ │Overview: A test edition overview. │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │Overview: original cover of ISBN 075640407X │ │
|
||||
│ │ │ │
|
||||
│ │My name is Kvothe, pronounced nearly the same as "quothe." │ │
|
||||
│ │ │ │
|
||||
│ │The Adem call me Maedre: which means The Flame. │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
|
||||
+3
-3
@@ -19,11 +19,11 @@ expression: output
|
||||
│ASIN: B0043RSJ9S │
|
||||
│Ratings: 4.5 (1000 votes) │
|
||||
│Monitored: true │
|
||||
│Overview: A test edition overview. │
|
||||
│ │
|
||||
│ │
|
||||
│Overview: original cover of ISBN 075640407X │
|
||||
│ │
|
||||
│My name is Kvothe, pronounced nearly the same as "quothe." │
|
||||
│ │
|
||||
│The Adem call me Maedre: which means The Flame. │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
|
||||
+3
-3
@@ -17,11 +17,11 @@ expression: output
|
||||
│ASIN: B0043RSJ9S │
|
||||
│Ratings: 4.5 (1000 votes) │
|
||||
│Monitored: true │
|
||||
│Overview: A test edition overview. │
|
||||
│ │
|
||||
│ │
|
||||
│Overview: original cover of ISBN 075640407X │
|
||||
│ │
|
||||
│My name is Kvothe, pronounced nearly the same as "quothe." │
|
||||
│ │
|
||||
│The Adem call me Maedre: which means The Flame. │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
|
||||
+3
-3
@@ -19,11 +19,11 @@ expression: output
|
||||
│ASIN: B0043RSJ9S │
|
||||
│Ratings: 4.5 (1000 votes) │
|
||||
│Monitored: true │
|
||||
│Overview: A test edition overview. │
|
||||
│ │
|
||||
│ │
|
||||
│Overview: original cover of ISBN 075640407X │
|
||||
│ │
|
||||
│My name is Kvothe, pronounced nearly the same as "quothe." │
|
||||
│ │
|
||||
│The Adem call me Maedre: which means The Flame. │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
|
||||
Reference in new issue
Block a user