From 31eb6d9298e16e7cc6c01057fe5f8a2aab955d1d Mon Sep 17 00:00:00 2001 From: Duncan Beevers Date: Mon, 1 Sep 2014 23:24:08 -0500 Subject: [PATCH] Push to stack after attribute processing --- src/htmlparser.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/htmlparser.js b/src/htmlparser.js index 0535473..26093cd 100644 --- a/src/htmlparser.js +++ b/src/htmlparser.js @@ -305,13 +305,6 @@ unary = empty[ tagName ] || !!unary; - if ( !unary ) { - stack.push( tagName ); - } - else { - unarySlash = tag.match( endingSlash ); - } - var attrs = []; rest.replace(attr, function () { @@ -361,6 +354,14 @@ }); }); + if ( !unary ) { + stack.push( tagName ); + } + else { + unarySlash = tag.match( endingSlash ); + } + + if ( handler.start ) { handler.start( tagName, attrs, unary, unarySlash ); } -- 2.34.1