<core:inHead variable="aHead" /> add whitespace even when request.inHead is empty

A while back there was added code to fix line endings


Can the CRLF be moved into _farcryOnRequestEnd.cfm where the <link> and <script> tags actually are outputted?

Can you show me the problem in your HTML output that you are trying to fix? Is it just an extra blank line that is appearing?

I think you can see the whitespace on all FarCry sites, take a look at www.farcrycore.org

this is whitespace
<!DOCTYPE html>

Easy fix for this would be to add a cfif around the code, like this:

<cfif arrayLen(aResult)>
	<cfset st = structnew() />
	<cfset st["id"] = "CRLF" />
	<cfset st["html"] = CRLF />
	<cfset arrayappend(aResult,st) />

Output would then be

<!DOCTYPE html>

Hmmm, I don’t think it would cause a blank first line in the output… AFAIK the doctype is almost always on the first line for the sites we build, e.g.


Not sure why the Core website has a blank line but I can take a look on Monday morning :smile:

In fact I think the blank line on farcrycore.org could be the same reason as daemon.com.au – both have CloudFlare in front of them for caching…

Your probably right, it could also be that <!DOCTYPE html> is one line below <cfoutput>.

My test is with a webskin not design to show anything other than plain text, if you use the webskin below, you will see the whitespace:

<!--- @@Copyright: Copyright (c) 2015 Amerika. All rights reserved. --->
<!--- @@License:
	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU Lesser General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	GNU Lesser General Public License for more details.

	You should have received a copy of the GNU Lesser General Public License
	along with this program. If not, see <http://www.gnu.org/licenses/>.

<!--- @@displayname: displayPageSomething.cfm --->
<!--- @@description: There is no description for this template. Please add or remove this message. --->
<!--- @@author: Jørgen M. Skogås (jorgen@amerika.no) on 2015-04-24 --->

<!--- Output: Plain text content
////////////////////////////////////////////////////////////////////////////////////////////////////// --->

<cfsetting enablecfoutputonly="false" />

Ahhh, interesting… With this webskin, there is no leading whitespace.

<cfsetting enablecfoutputonly="true">

<cfoutput><!DOCTYPE html>

<cfsetting enablecfoutputonly="false">

But if you remove the <head> element from the HTML then leading whitespace does get added, and the output becomes:

-- blank line --
<!DOCTYPE html>

I’ll add the check on the array length to p710. Let me know if you need it in p700 and I’ll cherry pick it :smile:

Fix is in both p710 and p700 :wink:

1 Like