From 2d8f303f14bf97b599645eb673761e3abf29718e Mon Sep 17 00:00:00 2001 From: Matt Huntington Date: Sat, 23 Jan 2016 13:32:47 -0500 Subject: [PATCH] use popHTMLStack for same depth and less than depth --- index.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index 62efea8..3d779c5 100755 --- a/index.js +++ b/index.js @@ -33,11 +33,8 @@ module.exports = function(input, callback){ var current_line_num_tabs = tabs_array.length - 1; if(current_line_num_tabs > previous_line_num_tabs){ html += insertTabs(current_line_num_tabs * 2) + '\n'); - } else if (current_line_num_tabs === previous_line_num_tabs) { - html += html_stack.pop(); - } - else if(current_line_num_tabs < previous_line_num_tabs){ + html_stack.push(insertTabs(current_line_num_tabs * 2) + '\n'); + } else { html += popHTMLStack(current_line_num_tabs, previous_line_num_tabs); } html += insertTabs((current_line_num_tabs * 2) + 1) + '
  • \n';