Consider this example dedent` test test2 ` Outputs test test2 Regex in line 43 (`l.match(/^(\s+)\S+/);`) should probably read `\s*` instead of `\s+`.