I could replace in line 25 with

   var firstDataText = firstData.textContent.replace(/ ee\s*=\s\{http:\/\/dx\.doi\.org\/(10\.)/, " doi = {$1").replace(/ ee\s*=/, " url =");

What do you think?