CFScript enhancement equivalent to JS template literal

After having gotten very used to not having to worry about escaping internal quotes in a string using JS Template Literals (since they are declared with backtick character), it would be very nice to not have to worry about in in cfscript as well.

Example:
dump(`this is a string with "quote's"`);

What I like: Small change that reduces errors, confusion and annoyance.
What I don’t like: Would diverge ACF and LUCEE (but maybe ACF would add it!)
Gut feeling: Yes, let’s do it!

Do you embed a lot of complex strings in scripts?

Just curious about the usage here, personally I mostly face this issue with constructing complex exception strings for Lucee in java, which is why we wrap stuff in [brackets]

As for diverging from ACF, not a huge concern and I can’t for see how this might cause issues in the future (famous last words, like using modern for localmode and PDF engines, seemed modern at the time)

I wouldn’t say complex but quotes certainly come up a lot.

Just today i was implementing a function in cfscript that returns html content and i ended up breaking out of cfscript back to cftags specifically just so i could use cfsavecontent without having to worry about escaping quotes in my html strings.

Of course cfsavecontent in tags is also nice because you can use cfif statements for small little cases without your markup getting confusing looking.

This just made me remember Tag Islands, wonder if that would do the trick instead.

Sidenote, did Tag Islands go away (or never get fully baked)?

I never used them, but trying out Ben Nadel example throws an error on lucee 5 and 6 on trycf.com

<cfscript>
	echo( "<p>Pre tag-island</p>" );
	```
	<p>In tag-island</p>
	```
	echo( "<p>Post tag-island</p>" );
</cfscript>
1 Like

trycf is just a bit weird sometimes, cfabort also doesn’t work

works fine for me locally