From 706391bce4dade1470129c0681bf39df388ef917 Mon Sep 17 00:00:00 2001 From: Avram Lyon Date: Sat, 5 Feb 2011 14:17:35 +0000 Subject: [PATCH] Trans: Stripping out section tags in abstracts, per http://forums.zotero.org/discussion/16254 --- translators/NCBI PubMed.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/translators/NCBI PubMed.js b/translators/NCBI PubMed.js index 4686d0e4a8..cf8d8d1df0 100644 --- a/translators/NCBI PubMed.js +++ b/translators/NCBI PubMed.js @@ -9,7 +9,7 @@ "priority":100, "configOptions":{"dataMode":"block"}, "inRepository":true, - "lastUpdated":"2011-01-27 10:15:00" + "lastUpdated":"2011-02-05 10:15:00" } function detectWeb(doc, url) { @@ -195,7 +195,9 @@ function doImportFromText(text) { newItem.tags.push(keywords[k].DescriptorName.text().toString()); } } + // We use a regex to remove the section labels newItem.abstractNote = article.Abstract.AbstractText.toString() + .replace(/<\/?AbstractText\s*(?:Label=")?([^">]+)?[^>]*>/g, "$1\n"); newItem.DOI = xml.PubmedArticle[i].PubmedData.ArticleIdList.ArticleId.(@IdType == "doi" ).text().toString(); newItem.publicationTitle = Zotero.Utilities.capitalizeTitle(newItem.publicationTitle);