Weird Ruby: Heredoc Delimiters

3 · Bozhidar Batsov · Jan. 20, 2022, 7:03 a.m.
Remember how I thought that the syntax for single-quoted heredocs was weird? I’ve got something even weirder for you today! Turns out that when using single-quoted heredoc delimiters you can have pretty much anything in them, including spaces! <<'END HTML' <html> ... </html> END HTML <<'\n!"£$%^&*()-=_+[];#{}:@~,./<>?|`\' hello \n!"£$%^&*()-=_+[];#{}:@~,./<>?|`\ It never crossed my mind that something like this would be possible until I came across this RuboCop ticket, asking for space...