plugins: Better fix for LGTM security warning

This commit is contained in:
Richard Hansen 2021-02-22 04:30:52 -05:00 committed by John McLear
parent a102bbfbef
commit d9c2778d17

View file

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