www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 64fb9efa760d22c83f2875b19a57c6381a3e81a0
parent 305edd893cdf0088e97a1f9fc1338fd15466d229
Author: Dan Stillman <dstillman@zotero.org>
Date:   Fri, 22 Nov 2013 21:58:19 -0500

Fix newlines not showing up in Abstract/Extra fields

Diffstat:
Mchrome/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 @@ -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 // <description> 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);