plugins: Better fix for LGTM security warning

pull/4827/head
Richard Hansen 2021-02-22 04:30:52 -05:00 committed by John McLear
parent a102bbfbef
commit d9c2778d17
1 changed files with 6 additions and 6 deletions

View File

@ -84,12 +84,12 @@ $(document).ready(() => {
for (const attr in plugin) {
if (attr === 'name') { // Hack to rewrite URLS into name
const link = $('<a href="">'); // intentional null href
link.attr('href', `https://npmjs.org/package/${plugin.name}`);
link.attr('plugin', 'Plugin details');
link.attr('rel', 'noopener noreferrer');
link.attr('target', '_blank');
link.text(plugin.name.substr(3));
const link = $('<a>')
.attr('href', `https://npmjs.org/package/${plugin.name}`)
.attr('plugin', 'Plugin details')
.attr('rel', 'noopener noreferrer')
.attr('target', '_blank')
.text(plugin.name.substr(3));
row.find('.name').append(link);
} else {
row.find(`.${attr}`).text(plugin[attr]);