From 0432da1d258a0fb5ad06d11f1d84e6d77a276b01 Mon Sep 17 00:00:00 2001 From: Avram Lyon Date: Sun, 13 Feb 2011 12:47:49 +0000 Subject: [PATCH] Trans: Remove datamode for 2.1, fix handling of newlines per http://forums.zotero.org/discussion/16071 --- translators/RIS.js | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/translators/RIS.js b/translators/RIS.js index a4c8e375ab..789dde3cf5 100644 --- 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", "
", "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 =>

, \n =>
+ //str = Zotero.Utilities.htmlSpecialChars(str); + value = '

' + + value.replace(/\n\n/g, '

') + .replace(/\n/g, '
') + .replace(/\t/g, '    ') + .replace(/ /g, '  ') + + '

'; + item.notes.push({note:value}); + } else item.notes.push({note:value}); } } else if(tag == "N2") { // abstract