Bug #11989
Updated by nobu (Nobuyoshi Nakada) over 6 years ago
It is clear that the dedenting <<~HEREDOC feature was intended to only consider actual whitespace in the source file as indentation, not any escaped whitespace. E.g.: ~~~ruby ~~~ p <<~"E" \ x y E ~~~ It prints `" x\n y\n"`. So `"\ "` does not count as whitespace. There is even an MRI test for this. However, this case is handled differently: ~~~ruby ~~~ p <<~"E" x\n y E ~~~ It prints `"x\n y\n"`. So `"\n"` is counted as whitespace, like an actual newline would be. I think it should print `"x\n y\n"`.