diff --git a/src/helpers/citation.js b/src/helpers/citation.js index 1f98bf7..a419441 100644 --- a/src/helpers/citation.js +++ b/src/helpers/citation.js @@ -114,13 +114,22 @@ function doi_string(ent, new_line){ } } +function title_string(ent) { + return '' + ent.title + ' '; +} + export function bibliography_cite(ent, fancy){ if (ent){ - var cite = '' + ent.title + ' '; + var cite = title_string(ent); cite += link_string(ent) + '
'; - cite += author_string(ent, '${L}, ${I}', ', ', ' and '); - if (ent.year || ent.date){ - cite += ', ' + (ent.year || ent.date) + '. '; + if (ent.author) { + cite += author_string(ent, '${L}, ${I}', ', ', ' and '); + if (ent.year || ent.date) { + cite += ', '; + } + } + if (ent.year || ent.date) { + cite += (ent.year || ent.date) + '. '; } else { cite += '. '; }