From ea2a5f5c3bf842a01de3054afc23dc7672253dde Mon Sep 17 00:00:00 2001 From: wojtask9 Date: Fri, 21 Jul 2017 06:44:27 +0200 Subject: [PATCH] add identation value to token (#34) * add identation value to token * fix lint problems * use var instead of let --- src/tokenizer.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tokenizer.js b/src/tokenizer.js index 45eee19f1..cde44d1d4 100644 --- a/src/tokenizer.js +++ b/src/tokenizer.js @@ -36,6 +36,10 @@ function parse (html, filepath, options) { token.name = match[1] token.args = match[2] + // get last line indentation + var lineStart = (htmlFragment || '').split('\n') + token.indent = lineStart[lineStart.length - 1].length + tokens.push(token) } else { // output