adding pagination patch from Rintze
This commit is contained in:
parent
5a7f3b1500
commit
92a29a7ad5
1 changed files with 11 additions and 1 deletions
|
@ -84,7 +84,17 @@ function lookupPMIDs(ids, doc) {
|
|||
}
|
||||
|
||||
if (article.Pagination.MedlinePgn.length()){
|
||||
newItem.pages = article.Pagination.MedlinePgn.text().toString();
|
||||
var fullPageRange = article.Pagination.MedlinePgn.text().toString();
|
||||
var pageRange = fullPageRange.match(/\d+-\d+/g);
|
||||
for (i in pageRange) {
|
||||
var pageRangeStart = pageRange[i].match(/^\d+/).join("");
|
||||
var pageRangeEnd = pageRange[i].match(/\d+$/).join("");
|
||||
if (pageRangeStart.length > pageRangeEnd.length) {
|
||||
pageRangeEnd = pageRangeStart.substring(0,pageRangeStart.length-pageRangeEnd.length) + pageRangeEnd;
|
||||
fullPageRange = fullPageRange.replace(pageRange[i],pageRangeStart+"-"+pageRangeEnd);
|
||||
}
|
||||
}
|
||||
newItem.pages = fullPageRange;
|
||||
}
|
||||
|
||||
if(article.Journal.length()) {
|
||||
|
|
Loading…
Reference in a new issue