Skip to content

Commit

Permalink
Slightly more sophisticated name formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
nomeata committed Jan 21, 2013
1 parent 73514b8 commit 272fe00
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion share/spice/doi/spice.js
Expand Up @@ -4,7 +4,25 @@
function ddg_spice_doi(bib) {

function format_author(author) {
return author['literal']
if (author['family']) {
var ret = "";
if (author['given']) {
ret += author['given'] + " ";
}
if (author['dropping-particle']) {
ret += author['dropping-particle'] + " ";
}
if (author['non-dropping-particle']) {
ret += author['non-dropping-particle'] + " ";
}
ret += author['family'];
if (author['suffix']) {
ret += " " + author['suffix'];
}
return ret;
} else {
return author['literal']
}
}

function format_authors(authors) {
Expand Down

0 comments on commit 272fe00

Please sign in to comment.