From: XhmikosR Date: Tue, 23 Dec 2014 17:38:28 +0000 (+0200) Subject: Style consistency changes. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=5194d910934c6f3bca655d72b37fc5eda950cd59;p=html-minifier.git Style consistency changes. [ci skip] --- diff --git a/dist/htmlminifier.js b/dist/htmlminifier.js index 64bd4d8..34071d7 100644 --- a/dist/htmlminifier.js +++ b/dist/htmlminifier.js @@ -621,13 +621,13 @@ preserveAfter = lineBreakAfter.test(str) ? '\n' : ' ', lineBreakStamp = 'htmlmincollapsedlinebreak'; - if (prevTag && prevTag !== 'img' && prevTag !== 'input' && (prevTag.substr(0,1) !== '/' - || ( prevTag.substr(0,1) === '/' && tags.indexOf(prevTag.substr(1)) === -1))) { + if (prevTag && prevTag !== 'img' && prevTag !== 'input' && (prevTag.substr(0, 1) !== '/' + || ( prevTag.substr(0, 1) === '/' && tags.indexOf(prevTag.substr(1)) === -1))) { str = str.replace(/^\s+/, options.conservativeCollapse ? ' ' : options.preserveLineBreaks ? preserveBefore : ''); } - if (nextTag && nextTag !== 'img' && nextTag !== 'input' && (nextTag.substr(0,1) === '/' - || ( nextTag.substr(0,1) !== '/' && tags.indexOf(nextTag) === -1))) { + if (nextTag && nextTag !== 'img' && nextTag !== 'input' && (nextTag.substr(0, 1) === '/' + || ( nextTag.substr(0, 1) !== '/' && tags.indexOf(nextTag) === -1))) { str = str.replace(/\s+$/, options.conservativeCollapse ? ' ' : options.preserveLineBreaks ? preserveAfter : ''); } diff --git a/src/htmlminifier.js b/src/htmlminifier.js index 1ff9560..2f346b6 100644 --- a/src/htmlminifier.js +++ b/src/htmlminifier.js @@ -55,13 +55,13 @@ preserveAfter = lineBreakAfter.test(str) ? '\n' : ' ', lineBreakStamp = 'htmlmincollapsedlinebreak'; - if (prevTag && prevTag !== 'img' && prevTag !== 'input' && (prevTag.substr(0,1) !== '/' - || ( prevTag.substr(0,1) === '/' && tags.indexOf(prevTag.substr(1)) === -1))) { + if (prevTag && prevTag !== 'img' && prevTag !== 'input' && (prevTag.substr(0, 1) !== '/' + || ( prevTag.substr(0, 1) === '/' && tags.indexOf(prevTag.substr(1)) === -1))) { str = str.replace(/^\s+/, options.conservativeCollapse ? ' ' : options.preserveLineBreaks ? preserveBefore : ''); } - if (nextTag && nextTag !== 'img' && nextTag !== 'input' && (nextTag.substr(0,1) === '/' - || ( nextTag.substr(0,1) !== '/' && tags.indexOf(nextTag) === -1))) { + if (nextTag && nextTag !== 'img' && nextTag !== 'input' && (nextTag.substr(0, 1) === '/' + || ( nextTag.substr(0, 1) !== '/' && tags.indexOf(nextTag) === -1))) { str = str.replace(/\s+$/, options.conservativeCollapse ? ' ' : options.preserveLineBreaks ? preserveAfter : ''); }