www

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

commit 0432da1d258a0fb5ad06d11f1d84e6d77a276b01
parent d8966467dc68f4940f33df54f5592f6ca59b8781
Author: Avram Lyon <ajlyon@gmail.com>
Date:   Sun, 13 Feb 2011 12:47:49 +0000

Trans: Remove datamode for 2.1, fix handling of newlines per http://forums.zotero.org/discussion/16071


Diffstat:
Mtranslators/RIS.js | 22++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/translators/RIS.js b/translators/RIS.js @@ -4,13 +4,12 @@ "label":"RIS", "creator":"Simon Kornblith", "target":"ris", - "minVersion":"2.1b2", + "minVersion":"2.1b6", "maxVersion":"", "priority":100, "inRepository":true, - "configOptions":{"dataMode":"block"}, "displayOptions":{"exportCharset":"UTF-8", "exportNotes":true}, - "lastUpdated":"2011-01-11 04:31:00" + "lastUpdated":"2011-02-13 03:10:59" } function detectImport() { @@ -107,8 +106,8 @@ var inputTypeMap = { }; function processTag(item, tag, value) { - if (Zotero.Utilities.unescapeHTML) { - value = Zotero.Utilities.unescapeHTML(value.replace("\n", "<br>", "g")); + if (tag != "N1" && tag != "AB" && Zotero.Utilities.unescapeHTML) { + value = Zotero.Utilities.unescapeHTML(value); } if(fieldMap[tag]) { @@ -245,7 +244,18 @@ function processTag(item, tag, value) { } else if(tag == "N1" || tag == "AB") { // notes if(value != item.title) { // why does EndNote do this!? - item.notes.push({note:value}); + var clean = Zotero.Utilities.cleanTags(value); + if (clean == value) { + // \n\n => <p>, \n => <br/> + //str = Zotero.Utilities.htmlSpecialChars(str); + value = '<p>' + + value.replace(/\n\n/g, '</p><p>') + .replace(/\n/g, '<br/>') + .replace(/\t/g, '&nbsp;&nbsp;&nbsp;&nbsp;') + .replace(/ /g, '&nbsp;&nbsp;') + + '</p>'; + item.notes.push({note:value}); + } else item.notes.push({note:value}); } } else if(tag == "N2") { // abstract