diff --git a/index.js b/index.js index 1688fa15..4e9d1002 100644 --- a/index.js +++ b/index.js @@ -102,7 +102,7 @@ module.exports = function (options) { // Determine the level of indentation lines.forEach(function(line) { if (line[0] === '<') return; - var wsp = line.search(/\S/) + var wsp = line.search(/\S|$/) level = (level === null || (wsp < line.length && wsp < level)) ? wsp : level; })