Skip to content

Keep line breaks, remove indentation #52

Description

@jtmueller

This is very handy, but it would be nice in some cases to have the option to preserve line breaks, but condense consecutive white-space characters after each line break. That would allow the creation of multi-line strings that are indented in the code, but not in the output.

function generateLetter() {
    return `Dear Sir or Madam,
                 
            We are writing to inform you that this example will clearly show that as of
            ${new Date().toLocaleString()} line breaks are preserved, but leading space from
            each line is stripped away.

            Sincerely,
            Us`;
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions