Hack to wrap URLs and DOIs in HTML bibliography output in <a href=""> links -- regexps might need to be improved
This commit is contained in:
parent
480743e5be
commit
5aae6bc9ce
1 changed files with 8 additions and 0 deletions
|
@ -407,6 +407,14 @@ Zotero.CSL.prototype.formatBibliography = function(itemSet, format) {
|
|||
if(format == "HTML") {
|
||||
var coins = Zotero.OpenURL.createContextObject(item.zoteroItem, "1.0");
|
||||
|
||||
// Wrap URLs in <a href=""> links, in a very unsophisticated manner
|
||||
//
|
||||
// This should be done earlier when the data is still in variables
|
||||
//
|
||||
// Ignore URLs preceded by '>', since these are likely already links
|
||||
string = string.replace(/([^>])(https?:\/\/[^\s]+)([\.">:])/g, '$1<a href="$2">$2</a>$3');
|
||||
string = string.replace(/(doi:[ ]*)([0-9][^\s]+[0-9])/g, '$1<a href="http://dx.doi.org/$2">$2</a>');
|
||||
|
||||
var span = (coins ? ' <span class="Z3988" title="'+coins.replace("&", "&", "g")+'"> </span>' : '');
|
||||
|
||||
if(this.class == "note" && isCitation) {
|
||||
|
|
Loading…
Add table
Reference in a new issue