diff --git a/scripts/web.js b/scripts/web.js index 992108db0..4db1c0cf3 100644 --- a/scripts/web.js +++ b/scripts/web.js @@ -148,7 +148,7 @@ if(!util.isTravisCI() || (util.isTravisCI() && (process.env['TRAVIS_EVENT_TYPE'] let commits = resCommits.headers.link.split('&').slice(-1)[0].replace(/[^\d]/g, ''), contribs = resContributors.headers.link.split('&').slice(-1)[0].replace(/[^\d]/g, ''), stars = resStars.headers.link.split('&').slice(-1)[0].replace(/[^\d]/g, ''); - indexStaticFile = indexStaticFile.replace(/\$snippet-count/g, Object.keys(snippets).length).replace(/\$commit-count/g, commits).replace(/\$contrib-count/g,contribs).replace(/\$star-count/g, stars); + indexStaticFile = indexStaticFile.replace(/\$snippet-count/g, Object.keys(snippets).length).replace(/\$commit-count/g, commits).replace(/\$contrib-count/g, contribs).replace(/\$star-count/g, stars); indexStaticFile = minify(indexStaticFile, { collapseBooleanAttributes: true, collapseWhitespace: true, @@ -186,12 +186,12 @@ try { for (let tag of [...new Set(Object.entries(tagDbData).map(t => t[1][0]))] .filter(v => v) .sort((a, b) => util.capitalize(a, true) === 'Uncategorized' ? 1 : util.capitalize(b, true) === 'Uncategorized' ? -1 : a.localeCompare(b))) { - output += '
/g, '') - .replace(/<\/p>/g, '') + - ''; + output += '
/g, '') + .replace(/<\/p>/g, '') + + ''; for (let taggedSnippet of Object.entries(tagDbData).filter(v => v[1][0] === tag)) output += md .render(`[${taggedSnippet[0]}](./${tag}#${taggedSnippet[0].toLowerCase()})\n`) @@ -206,7 +206,7 @@ try { for (let tag of [...new Set(Object.entries(tagDbData).map(t => t[1][0]))] .filter(v => v) .sort((a, b) => util.capitalize(a, true) === 'Uncategorized' ? 1 : util.capitalize(b, true) === 'Uncategorized' ? -1 : a.localeCompare(b))) { - let localOutput = output.replace(/\$tag/g, util.capitalize(tag)).replace(new RegExp(`./${tag}#`,'g'),'#'); + let localOutput = output.replace(/\$tag/g, util.capitalize(tag)).replace(new RegExp(`./${tag}#`, 'g'), '#'); localOutput += md .render(`## ${util.capitalize(tag, true)}\n`) .replace(/
([^\0]*?)<\/code><\/pre>/gm, (match, p1) => `${Prism.highlight(unescapeHTML(p1), Prism.languages.javascript)}`)
.replace(/<\/pre>\s+📋 Copy to clipboard' +
'