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