OpenBD / openbd-core

The original open source Java powered GPL CFML runtime engine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

White spaces

LiQz0r opened this issue · comments

Hey,

I am experiencing some odd behavior regarding white spaces.

<cfoutput>START</cfoutput>

<cfoutput>STOP</cfoutput>

The simple cfm file above produces a source file containing 24 lines. Why aren't the white spaces and empty lines trimmed from the source? It seems like OpenBD preserves the structure of the original cfm file and only strips out the cf-tags. I can understand that you want to keep the line between "START" and "STOP", but where does the other 21 lines come from?

When I load up the same file in Adobe's ColdFusion I only get one single line where the words have been separated by a single white space.

whitespace questions are quite common for ColdFusion. Since OpenBD is different code from Adobe's ColdFusion, you could get more whitespace. Nevertheless, whitespace can also be produced by Application.cfm / Application.cfc. You could also try SUPPRESSWHITESPACE with CFPROCESSSINGDIRECTIVE to reduce it, or write a filter for Tomcat, something like https://www.oliver-frick.ch/?p=268

I tried your example. I have an Appliation.cfc. With
<cfcomponent output="false">
in there, i get 3 lines before START, with
<cfcomponent output="true">
there are 14.

Great, thanks for the quick reply!

I tried your suggestion and applied <cfprocessingdirective suppressWhiteSpace="yes"> to both my test cfm file and the Application.cfm file, and this greatly reduced the number of empty lines in the HMTL source file to only three. Weirdly enough it actually added an empty line at the end of the file which previously wasn't there.