Friday, January 10, 2014

cfprocessingdirective

For years we have been using the tag cfprocessingdirective Tag at the top of our templates like this.

<cfprocessingdirective suppresswhitespace="yes" pageencoding="utf-8">

Then one of our colleagues found this in the Adobe Docs

"The cfprocssingdirective tag has limitations that depend on the attribute you use. For this reason, Adobe recommends that you include either the pageencoding or suppresswhitespace attribute in a cfprocessingdirective tag, not both." 

Ah hah. Afterwards we began to modify the templates.

<cfprocessingdirective pageEncoding="utf-8" />
<cfprocessingdirective suppressWhitespace="true">
...[some code]
</cfprocessingdirective>

It struck me however after playing around with the tag that the suppressWhitespace attribute did not seem to have an effect on the white space emitted. The white space was being stripped out regardless whether the tag was present or not. A quick check showed me that the "Enable Whitespace Management" Option on the server was active.

Thus it appears this setting essentially replicates at the page level the global setting for Whitespace Management.

2 comments: