tree-sitter-dockerfile icon indicating copy to clipboard operation
tree-sitter-dockerfile copied to clipboard

Whitespace after line continuation breaks syntax highlighting

Open eortega-pjr opened this issue 3 years ago • 2 comments

sorry if this is already known

RUN echo "foo" \<space> 
    echo "feh"
### no syntax hereafter due to space after \ above

eortega-pjr avatar Oct 06 '22 20:10 eortega-pjr

Would have never caught that!

Glad I found this.

zbroniszewski avatar Nov 11 '22 16:11 zbroniszewski

encountered this too

gruhn avatar Jan 11 '23 18:01 gruhn

It's actually pretty surprising to me that docker accepts that. In most other languages I've used, the backslash is escaping only the next character, which is not a newline in this case. In any case, fixed it in #49

camdencheek avatar Apr 19 '24 21:04 camdencheek

It's actually pretty surprising to me that docker accepts that. In most other languages I've used, the backslash is escaping only the next character, which is not a newline in this case. In any case, fixed it in #49

I wouldn't be surprised if the Dockerfile parser trims whitespace off the end of each line.

eortega-pjr avatar Apr 19 '24 22:04 eortega-pjr