From c7c8544de99e218b368a79e2eb4404c9637f7770 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 25 Jun 2007 21:47:52 +0000 Subject: [PATCH] - Added new Zotero.Utilities method, unescapeHTML() - Unescape HTML entities in RIS files automatically --- chrome/content/zotero/xpcom/utilities.js | 7 +++++++ scrapers.sql | 10 +++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/xpcom/utilities.js b/chrome/content/zotero/xpcom/utilities.js index 3cc787c5f..c0455c147 100644 --- a/chrome/content/zotero/xpcom/utilities.js +++ b/chrome/content/zotero/xpcom/utilities.js @@ -162,6 +162,13 @@ Zotero.Utilities.prototype.htmlSpecialChars = function(str) { return newString; } +/* +Zotero.Utilities.prototype.unescapeHTML = function(str) { + var nsISUHTML = Components.classes["@mozilla.org/feed-unescapehtml;1"] + .getService(Components.interfaces.nsIScriptableUnescapeHTML); + return nsISUHTML.unescape(str); +} +*/ /* * Parses a text string for HTML/XUL markup and returns an array of parts diff --git a/scrapers.sql b/scrapers.sql index cececfef5..5868bade4 100644 --- a/scrapers.sql +++ b/scrapers.sql @@ -1,4 +1,4 @@ --- 244 +-- 245 -- ***** BEGIN LICENSE BLOCK ***** -- @@ -22,7 +22,7 @@ -- Set the following timestamp to the most recent scraper update date -REPLACE INTO version VALUES ('repository', STRFTIME('%s', '2007-06-22 17:30:00')); +REPLACE INTO version VALUES ('repository', STRFTIME('%s', '2007-06-25 21:50:00')); REPLACE INTO translators VALUES ('96b9f483-c44d-5784-cdad-ce21b984fe01', '1.0.0b4.r1', '', '2007-06-21 20:00:00', '1', '100', '4', 'Amazon.com', 'Sean Takats', '^https?://(?:www\.)?amazon', 'function detectWeb(doc, url) { @@ -10524,7 +10524,7 @@ function doImport() { } }'); -REPLACE INTO translators VALUES ('32d59d2d-b65a-4da4-b0a3-bdd3cfb979e7', '1.0.0b4.r1', '', '2007-03-28 00:45:00', '1', '100', '3', 'RIS', 'Simon Kornblith', 'ris', +REPLACE INTO translators VALUES ('32d59d2d-b65a-4da4-b0a3-bdd3cfb979e7', '1.0.0b4.r1', '', '2007-06-25 21:50:00', '1', '100', '3', 'RIS', 'Simon Kornblith', 'ris', 'Zotero.configure("dataMode", "line"); Zotero.addOption("exportNotes", true); @@ -10614,6 +10614,10 @@ var inputTypeMap = { }; function processTag(item, tag, value) { + if (Zotero.Utilities.unescapeHTML) { + value = Zotero.Utilities.unescapeHTML(value); + } + if(fieldMap[tag]) { item[fieldMap[tag]] = value; } else if(inputFieldMap[tag]) {