diff --git a/src/helpers/citation.js b/src/helpers/citation.js index 943139e..25cd480 100644 --- a/src/helpers/citation.js +++ b/src/helpers/citation.js @@ -58,6 +58,11 @@ function author_string(ent, template, sep, finalSep){ var names = ent.author.split(' and '); let name_strings = names.map(name => { name = name.trim(); + if (name.match(/\{.+\}/)) { + var regExp = /\{([^}]+)\}/; + var matches = regExp.exec(name); + return matches[1]; + } if (name.indexOf(',') != -1){ var last = name.split(',')[0].trim(); var firsts = name.split(',')[1]; diff --git a/src/transforms/citation.js b/src/transforms/citation.js index ca5d23f..155741c 100644 --- a/src/transforms/citation.js +++ b/src/transforms/citation.js @@ -113,6 +113,11 @@ export default function(dom, data) { var names = ent.author.split(' and '); let name_strings = names.map(name => { name = name.trim(); + if (name.match(/\{.+\}/)) { + var regExp = /\{([^}]+)\}/; + var matches = regExp.exec(name); + return matches[1]; + } if (name.indexOf(',') != -1){ var last = name.split(',')[0].trim(); var firsts = name.split(',')[1];