I would prefer var a = `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` keepindentation`;
as a multiple line string, 2014-09-11 13:55 GMT+08:00 Sebastian Zartner <sebastianzart...@gmail.com>: > On 9 September 2014 16:51, Allen Wirfs-Brock <al...@wirfs-brock.com> > wrote: > >> Well, just for fun >> >> const N = "\n"; //maybe we could find evocative unicode name. >> var a = `This is a template string. ${ >> N}Even though each line is indented to keep the ${ >> N}code neat and tidy, the white space used to indent ${ >> N}is not in the resulting string`; >> > > To me this looks still somewhat hacky. > Couldn't a simple keyword be added at the the end of a template string? > So it would be something like this: > > var a = `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` keepindentation; > > This would explicitly keep the spaces at the beginning of each line while > without the keyword they would be removed. Of course the keyword may also > indicate the opposite depending on parsing would be chosen as default. > Surely the name for this keyword is not optimal yet and would need to be > discussed. > > Sebastian > > _______________________________________________ > es-discuss mailing list > es-discuss@mozilla.org > https://mail.mozilla.org/listinfo/es-discuss > >
_______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss