From e4fba52b33dd3a398e229128bf2269f79522c59f Mon Sep 17 00:00:00 2001 From: segayuu Date: Wed, 24 Oct 2018 11:31:36 +0900 Subject: [PATCH] Changed not to use Array#slice() --- lib/plugins/tag/img.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/plugins/tag/img.js b/lib/plugins/tag/img.js index ec51cda51e..eeb19c2f67 100644 --- a/lib/plugins/tag/img.js +++ b/lib/plugins/tag/img.js @@ -37,14 +37,10 @@ module.exports = ctx => { let src; // Find image URL and class name - for (let i = 0, len = args.length; i < len; i++) { - const item = args[i]; - + while (args.length > 0) { + const item = args.shift(); if (rUrl.test(item) || item[0] === '/') { src = makeUrl(item); - - // Delete image URL and class name from arguments - args = args.slice(i + 1); break; } else { classes.push(item);