Project

General

Profile

Actions

Bug #19539

closed

Heredocs with leading spaces inconsistency

Added by hurricup (Alexandr Evstigneev) about 1 year ago. Updated about 1 year ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:112940]

Description

This is more like technical inconsistency that bothers me. Not sure someone will use this in real life, but still.
This works fine:

puts <<'    ABC'
marker with spaces
    ABC

But this is not:

puts <<-'    ABC'
marker with spaces
    ABC

as well as

puts <<~'    ABC'
marker with spaces
    ABC

I would expect it to wok properly, even in case:

puts <<-'    ABC'
    marker with spaces
        ABC
Actions

Also available in: Atom PDF

Like0
Like0Like1