MartinKolarik/dedent-js

Bug with escaped newlines

Opened this issue · 2 comments

dedent`foo\n    bar`

is not the same as

dedent`foo
    bar`

But both produces "foo\nbar"

dedent`foo\n    bar` should be "foo\n    bar"

This is in line with the test suite and readme. IIRC it wasn't possible to detect the difference. You can write it like this though:

dedent`
    foo
        bar
`

it's possible to detect via raw value of template strings

image