I just spent some time troubleshooting a whitespace issue in our
application and am curious if the behavior is as intended or if it's a
bug.

The issue is that the cfsavecontent element does not propagate the
current suppressWhiteSpace setting.   This can be seen with the
following example.  As you can see, the Y does not get whitespace
suppression, as I would have expected.  Is this intended?  I don't
have an easy way to test this in Coldfustion, which may have the same
behavior.

Code:
<cfprocessingdirective suppressWhiteSpace="true">
        <pre>[     X     ]</pre>
        <cfsavecontent variable="foo">
                <pre>[     Y     ]</pre>
                <cfprocessingdirective suppressWhiteSpace="true">
                        <pre>[     Z     ]</pre>
                </cfprocessingdirective>
        </cfsavecontent>
</cfprocessingdirective>

<cfoutput>#foo#</cfoutput>

Output:
[ X ]

[     Y     ]

[ Z ]


Side note: I dug through the code and the issue is around lines 55/56
of cfSAVECONTENT.java.  The renderToString() method is called without
setting the whitespace setting.


Thanks,
Richard Taylor
PIER Systems, Inc.

--~--~---------~--~----~------------~-------~--~----~
Open BlueDragon Public Mailing List
 http://groups.google.com/group/openbd?hl=en
 official site @ http://www.openbluedragon.org/

!! save a network - trim replies before posting !!
-~----------~----~----~----~------~----~------~--~---

Reply via email to