Skip to content

Commit

Permalink
MODS: allow more complex page range
Browse files Browse the repository at this point in the history
  • Loading branch information
adam3smith committed Apr 12, 2019
1 parent fa3e381 commit 191e1d1
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions MODS.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 191e1d1

Please sign in to comment.