From 13243d96bf5bf945cb68fe752598abc8a0b0274a Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Fri, 8 Aug 2025 23:14:22 +0200 Subject: exporter: Avoid trailing dots on bare-bone items MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some items are going to be really empty: just the title and the author; no year, no notes, etc. In these cases the exporter still tried to add this missing information. Signed-off-by: Miquel Sabaté Solà --- lib/plain_exporter.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/plain_exporter.rb') diff --git a/lib/plain_exporter.rb b/lib/plain_exporter.rb index 514d243..018c8f2 100644 --- a/lib/plain_exporter.rb +++ b/lib/plain_exporter.rb @@ -33,8 +33,11 @@ class PlainExporter < BaseExporter str += thing.note.present? ? "#{thing.note}. #{thing.publisher}" : thing.publisher end + str = str.strip if thing.address.present? str + ", #{thing.address}: #{thing.year}." + elsif str.blank? + nil else "#{str}." end -- cgit v1.2.3