indentjs/endent

Multiline interpolation breaks with non-whitespace prefix

Closed this issue · 2 comments

Given that

endent`
    foo.
    ${"hello\nworld"}
    bar.
`

correctly comes out as

foo.
hello
world
bar.    

I expect this:

endent`
    foo.
    x=${"hello\nworld"}
    bar.
`

to come out as

foo.
x=hello
  bar
bar.

but instead it comes out as

foo.
x=hello
world
bar.

and when I try to add the spaces on the second line myself

endent`
    foo.
    x=${"hello\n  world"}
    bar.
`

then it comes out even worse

foo.
    x=hello
world
    bar.

nice catch! fixed: endent: fix issue#2

Great, thanks!