Lucee injecting linebreak in function call

<cffunction name="wtf">
	<cfargument name="in" required="yes">
	<cfreturn in>
</cffunction>
<cfoutput>
	<cfset x=wtf('someString')>
	<br>-----#x#----
	<br>-----#wtf('someString')#----
</cfoutput>

results in


-----someString----
----- someString---- 

Note the gap in the -----#wtf('someString')#---- output - it seems to be a linebreak.

I don’t really recall how white space works in CFML regarding functions/CFCs because I already do this by default, but if you add output="false" to <cfunction...>, that should resolve what you’re seeing.

1 Like

Thanks! Still seem a bit buggish, but that works and is tolerable.

When I used to write my methods as tags I would always add output="false" (I was on ACF at the time).

One of the benefits of moving to script is that you don’t need to worry about white space since script methods don’t output anything unless you tell them to using WriteOutput() or Echo().