From 9036f9da1de96d6ef5cefacaa0088e33ffb03a3e Mon Sep 17 00:00:00 2001 From: Matt Huntington Date: Sat, 23 Jan 2016 12:32:18 -0500 Subject: [PATCH] back indenting more than once --- index.js | 3 +-- test.txt | 6 +++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 0146ad2..fe67478 100755 --- a/index.js +++ b/index.js @@ -17,11 +17,10 @@ module.exports = function(file_path, callback){ return result; } var popHTMLStack = function(html_stack, current_line_num_tabs, previous_line_num_tabs){ - var result = ''; + var result = html_stack.pop(); for(var i = previous_line_num_tabs; i > current_line_num_tabs; i--){ result += html_stack.pop(); result += html_stack.pop(); - result += html_stack.pop(); } return result; } diff --git a/test.txt b/test.txt index 815317b..48167e2 100644 --- a/test.txt +++ b/test.txt @@ -2,4 +2,8 @@ first line second line third line indented once indented twice - last line indented once + twice again + thrice + frice + back once + last line back indented twice