From 116c292f44f643ad31ff328ea8151b169d75601f Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 12 Jun 2008 06:34:12 +0000 Subject: [PATCH] Don't send text/html to clipboard for note copy, since we don't have rich-text notes and copying HTML on Windows just loses newlines (due to unsupported white-space: pre-wrap in Word and OO). --- chrome/content/zotero/xpcom/itemTreeView.js | 4 +++- chrome/content/zotero/xpcom/quickCopy.js | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/itemTreeView.js b/chrome/content/zotero/xpcom/itemTreeView.js index fb6c04c07..babf9c2d5 100644 --- a/chrome/content/zotero/xpcom/itemTreeView.js +++ b/chrome/content/zotero/xpcom/itemTreeView.js @@ -1475,7 +1475,9 @@ Zotero.ItemTreeView.prototype.onDragStart = function (evt,transferData,action) else if (mode.indexOf('bibliography') == 0) { var content = Zotero.QuickCopy.getContentFromItems(items, format); transferData.data.addDataForFlavour("text/unicode", content.text); - transferData.data.addDataForFlavour("text/html", content.html); + if (content.html) { + transferData.data.addDataForFlavour("text/html", content.html); + } } else { Components.utils.reportError("Invalid Quick Copy mode '" + mode + "'"); diff --git a/chrome/content/zotero/xpcom/quickCopy.js b/chrome/content/zotero/xpcom/quickCopy.js index 67436a9ee..a5223cf13 100644 --- a/chrome/content/zotero/xpcom/quickCopy.js +++ b/chrome/content/zotero/xpcom/quickCopy.js @@ -175,10 +175,18 @@ Zotero.QuickCopy = new function() { html = html.toXMLString(); + // Don't copy HTML, since we don't have rich-text notes and + // copying HTML on Windows just loses newlines (due to + // unsupported white-space: pre-wrap in Word and OO). + /* var content = { text: contentType == "html" ? html : content.join('\n\n\n'), html: html }; + */ + var content = { + text: contentType == "html" ? html : content.join('\n\n\n') + }; return content; }