diff --git a/background/preformatters/arxiv.js b/background/preformatters/arxiv.js index d0036d8..66e724d 100755 --- a/background/preformatters/arxiv.js +++ b/background/preformatters/arxiv.js @@ -1,73 +1,89 @@ var BINPreformatter = ( function () { + // a shadow as a "promise not to touch global data and variables". Must be included to be accepted! + var BINData = null; + var BINInteraction = null; + var BINParser = null; + var window = null; + var document = null; - // a shadow as a "promise not to touch global data and variables". Must be included to be accepted! - var BINData = null; - var BINInteraction = null; - var BINParser = null; - var window = null; - var document = null; - - //preformatting function - function preformatData(metaData, parser) { - - //fix beginning of abstract - let abstract = metaData["citation_abstract"].replace(/^Abstract:[\ ]+/,""); - - //fix math in abstract, math symbols saved in citation_misc - let mathSymbols = metaData["citation_misc"]; - - if (mathSymbols != "" && (mathSymbols = mathSymbols.split(/[\ ]+;[\ ]+/)) != null) { - const length = mathSymbols.length; - if (length%2 == 0) { - //index variable - let idx = 0; - for (let i = 0; i and var prefselectorMsg = { + citation_title: [ [ 'h1.title','textContent', true, 20000] ], + citation_title_nonlatex: [ [ 'meta[property="og:title"]','content'] ], citation_abstract: [ [ 'blockquote.abstract','textContent', true, 20000] ], - citation_misc: [ ['blockquote.abstract script[type="math/tex"], blockquote.abstract span.MathJax','textContent',true, 1024, true, 1000] ], /*for mathjax detection*/ - citation_keywords: [ [ 'td.tablecell.subjects','innerText'] ], + + /*for mathjax detection*/ + citation_misc: [ ['h1.title script[type="math/tex"], h1.title span.MathJax, blockquote.abstract script[type="math/tex"], blockquote.abstract span.MathJax','textContent',true, 1024, true, 1000] ], + + + + citation_keywords: [ [ 'td.tablecell.subjects','innerText'] ], citation_url: [ ['meta[property="og:url" i]','content'] ], citation_doi: [ ['meta[name="citation_doi"]','content'] , ['td.doi a','href'] , ['td.arxivdoi a','href'] ] };