From 64fb9efa760d22c83f2875b19a57c6381a3e81a0 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 22 Nov 2013 21:58:19 -0500 Subject: [PATCH] Fix newlines not showing up in Abstract/Extra fields --- chrome/content/zotero/bindings/itembox.xml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/bindings/itembox.xml b/chrome/content/zotero/bindings/itembox.xml index 55bbb0e7b..f82050e1f 100644 --- a/chrome/content/zotero/bindings/itembox.xml +++ b/chrome/content/zotero/bindings/itembox.xml @@ -1295,12 +1295,17 @@ var firstSpace = valueText.indexOf(" "); - // To support newlines in 'extra' fields, we use multiple + // To support newlines in Abstract and Extra fields, use multiple // elements inside a vbox if (useVbox) { var lines = valueText.split("\n"); for (var i = 0; i < lines.length; i++) { var descriptionNode = document.createElement("description"); + // Add non-breaking space to empty lines to prevent them from collapsing. + // (Just using CSS min-height results in overflow in some cases.) + if (lines[i] === "") { + lines[i] = "\u00a0"; + } var linetext = document.createTextNode(lines[i]); descriptionNode.appendChild(linetext); valueElement.appendChild(descriptionNode);