Skip to content

Commit 99d4b46

Browse files
committed
Reuse stringifyStartTag
1 parent 4874fb9 commit 99d4b46

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

lib/index.js

+1-11
Original file line numberDiff line numberDiff line change
@@ -240,16 +240,7 @@ module.exports = {
240240
},
241241
inspect: function (element, depth, output, inspect) {
242242
var elementName = element.nodeName.toLowerCase();
243-
var startTag = '<' + elementName;
244-
var attrs = getCanonicalAttributes(element);
245-
246-
Object.keys(attrs).forEach(function (key) {
247-
if (isBooleanAttribute(key)) {
248-
startTag += ' ' + key;
249-
} else {
250-
startTag += ' ' + key + '="' + attrs[key].replace(/&/g, '&amp;').replace(/"/g, '&quot;') + '"';
251-
}
252-
});
243+
var startTag = stringifyStartTag(element);
253244

254245
var inspectedChildren = [];
255246
if (elementName === 'script') {
@@ -273,7 +264,6 @@ module.exports = {
273264
return width > 50 || o.height > 1;
274265
});
275266

276-
startTag += '>';
277267
output.code(startTag, 'html');
278268
if (element.childNodes.length > 0) {
279269

0 commit comments

Comments
 (0)