- Added new Zotero.Utilities method, unescapeHTML()

- Unescape HTML entities in RIS files automatically
This commit is contained in:
Dan Stillman 2007-06-25 21:47:52 +00:00
parent ceb18b9eab
commit c7c8544de9
2 changed files with 14 additions and 3 deletions

View File

@ -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

View File

@ -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]) {