Skip to content
Permalink
Browse files

MODS: allow more complex page range

  • Loading branch information...
adam3smith committed Apr 12, 2019
1 parent fa3e381 commit 191e1d13adc757fa9206c8eb9907e1420679b529
Showing with 10 additions and 4 deletions.
  1. +10 −4 MODS.js
14 MODS.js
@@ -474,11 +474,17 @@ function doExport() {

// XML tag detail; object field pages
if (item.pages) {
var range = Zotero.Utilities.getPageRange(item.pages),
extent = doc.createElementNS(ns, "extent");
var extent = doc.createElementNS(ns, "extent");
extent.setAttribute("unit", "pages");
mapProperty(extent, "start", range[0]);
mapProperty(extent, "end", range[1]);
if (item.pages.search(/^\d+[-–]\d+$/) != -1) {
var range = ZU.getPageRange(item.pages);
mapProperty(extent, "start", range[0]);
mapProperty(extent, "end", range[1]);
}
else {
extent.setAttribute("unit", "pages");
mapProperty(extent, "list", item.pages);
}
part.appendChild(extent);
}

0 comments on commit 191e1d1

Please sign in to comment.
You can’t perform that action at this time.