Merge pull request #9366 from dannon/citation-link-tweak

Prevent duplicate listing of doi link and link (text, with href doi link)
This commit is contained in:
Marius van den Beek
2020-02-13 10:32:42 +01:00
committed by GitHub
@@ -150,14 +150,11 @@ export default {
fields.howpublished
)}${this._asSentence(fields.note)}`;
}
let doiUrl = "";
if (fields.doi) {
doiUrl = `https://doi.org/${fields.doi}`;
ref += `[<a href="${doiUrl}" target="_blank">doi:${fields.doi}</a>]`;
ref += `[<a href="https://doi.org/${fields.doi}" target="_blank">doi:${fields.doi}</a>]`;
}
const url = fields.url || doiUrl;
if (url) {
ref += `[<a href="${url}" target="_blank">Link</a>]`;
if (fields.url) {
ref += `[<a href="${fields.url}" target="_blank">Link</a>]`;
}
return convertLaTeX({ onError: (error, latex) => `{${stringifyLaTeX(latex)}}` }, ref);
},