Multiline template strings that don't break indentation

Allen Wirfs-Brock allen at wirfs-brock.com
Thu Sep 11 07:55:43 PDT 2014


On Sep 11, 2014, at 1:05 AM, Brendan Eich wrote:

> The tag goes at the front. What's missing from the design that can't be provided as a standard exported deindent function?

exactly:

        var a = dontIndent
                `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`;

or, following the precedent to 'raw':

        var a = String.noIndentation
                `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`;


Allen

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140911/172ca0fc/attachment.html>


More information about the es-discuss mailing list