Multiline template strings that don't break indentation

Domenic Denicola domenic at domenicdenicola.com
Thu Sep 18 16:52:57 PDT 2014


ALL of these things can be accomplished with your own custom tag. I really encourage you and others to learn about the "tag" part of "tagged template string".
________________________________
From: Merih<mailto:merihakar at gmail.com>
Sent: ‎2014-‎09-‎18 16:36
To: es-discuss at mozilla.org<mailto:es-discuss at mozilla.org>
Subject: Re: Re: Multiline template strings that don't break indentation

This might be beyond the current state of template strings but wouldn't it be nice if there was a delimiter character we can use to depict the beginning of each line of a multiline string? A similar solution like Scala multliline strings but without `stripMargin` method at the end.

For example:

    var multiLineString = `This is a template string.
                                      |Even though each line is indented to keep the
                                      |code neat and tidy, the white space used to indent
                                      |is not in the resulting string`

And if we actually want to include vertical bar we can escape it?

--
Merih Akar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140918/520b13f9/attachment.html>


More information about the es-discuss mailing list