Comparing version 0.1.1 to 0.1.2
16
index.js
@@ -17,13 +17,13 @@ var academia; | ||
acl.stringifyNames = stringifyNames; | ||
var name = '[A-Z][^()\\s]+'; | ||
var name = '[A-Z][^()\\s]+(?: [IV]+)?'; | ||
var year = '[0-9]{4}(?:[-–—][0-9]{4})?[a-z]?'; | ||
var citeSources = [ | ||
// et al., duo, and single, with year in parens | ||
(name + " et al. \\(" + year + "\\)"), | ||
(name + " and " + name + " \\(" + year + "\\)"), | ||
(name + " \\(" + year + "\\)"), | ||
(name + "\\s+et\\s+al.\\s+\\(" + year + "\\)"), | ||
(name + "\\s+(?:and|&)\\s+" + name + "\\s+\\(" + year + "\\)"), | ||
(name + "\\s+\\(" + year + "\\)"), | ||
// et al., duo, and single, with year not in parens (note the commas) | ||
(name + " et al., " + year + "\\b"), | ||
(name + " and " + name + ", " + year + "\\b"), | ||
(name + ", " + year + "\\b"), | ||
(name + "\\s+et\\s+al.,\\s+" + year + "\\b"), | ||
(name + "\\s+(?:and|&)\\s+" + name + ",\\s+" + year + "\\b"), | ||
(name + ",\\s+" + year + "\\b"), | ||
]; | ||
@@ -111,3 +111,3 @@ acl.citeRegExp = new RegExp(citeSources.join('|'), 'g'); | ||
// TODO: fix the 'et al.' hack | ||
return input.replace(/\s+et al\./, ', et al.').split(/,\s*and\s+|\s*and\s+|,\s*/); | ||
return input.replace(/\s+et al\./, ', et al.').split(/,\s*(?:and|&)\s+|\s*(?:and|&)\s+|,\s*/); | ||
} | ||
@@ -114,0 +114,0 @@ names.splitNames = splitNames; |
@@ -23,3 +23,3 @@ import types = require('./types'); | ||
// TODO: fix the 'et al.' hack | ||
return input.replace(/\s+et al\./, ', et al.').split(/,\s*and\s+|\s*and\s+|,\s*/); | ||
return input.replace(/\s+et al\./, ', et al.').split(/,\s*(?:and|&)\s+|\s*(?:and|&)\s+|,\s*/); | ||
} | ||
@@ -26,0 +26,0 @@ |
@@ -11,3 +11,3 @@ { | ||
], | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"homepage": "https://github.com/chbrown/academia", | ||
@@ -14,0 +14,0 @@ "repository": "git://github.com/chbrown/academia.git", |
@@ -14,3 +14,3 @@ import types = require('../types'); | ||
var name = '[A-Z][^()\\s]+'; | ||
var name = '[A-Z][^()\\s]+(?: [IV]+)?'; | ||
var year = '[0-9]{4}(?:[-–—][0-9]{4})?[a-z]?'; | ||
@@ -20,9 +20,9 @@ | ||
// et al., duo, and single, with year in parens | ||
`${name} et al. \\(${year}\\)`, | ||
`${name} and ${name} \\(${year}\\)`, | ||
`${name} \\(${year}\\)`, | ||
`${name}\\s+et\\s+al.\\s+\\(${year}\\)`, | ||
`${name}\\s+(?:and|&)\\s+${name}\\s+\\(${year}\\)`, | ||
`${name}\\s+\\(${year}\\)`, | ||
// et al., duo, and single, with year not in parens (note the commas) | ||
`${name} et al., ${year}\\b`, | ||
`${name} and ${name}, ${year}\\b`, | ||
`${name}, ${year}\\b`, | ||
`${name}\\s+et\\s+al.,\\s+${year}\\b`, | ||
`${name}\\s+(?:and|&)\\s+${name},\\s+${year}\\b`, | ||
`${name},\\s+${year}\\b`, | ||
]; | ||
@@ -29,0 +29,0 @@ export const citeRegExp = new RegExp(citeSources.join('|'), 'g'); |
@@ -108,1 +108,15 @@ // the original text from the paper (for debugging) | ||
// console.log(dts_string); | ||
/** | ||
config will be an object like: | ||
{ | ||
"styles": { | ||
"acl": "styles/acl" | ||
}, | ||
"names": "names", | ||
"types": "types" | ||
} | ||
*/ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
60686
18
1315
0