html/whitespace cleanup feature


Im not sure if this is the right place, but it would be a good feature
for coldbox, if you could specify in the coldbox.xml.cfm the following

parameters for <cfprocessingdirective pageencoding="utf-8"
suppresswhitespace="true"> tag,
so coldbox automatically wraps all layout+views in this tag.

maybe an optional cleanhtml / removewhitespace setting, which used a
method like this to clean layout+view:

  * Replaces a huge amount of unnecessary whitespace from your HTML

@Klaas-Jan Winkel

White space issue been fixed by Luis, if you are interested then try
to get latest code-base from SVN.

Like your idea but what will happend when users have textarea with
fckeditor ... ?


Im not sure how that editor works, but text within a textarea can be
skipped ofcourse..

Sana is right, just grap the latest version from SVN.


Was there a whitespace problem with coldbox-native methods? Im not
sure im talking about that, was more talking about removing whitespace
anywhere, also in my code for example.

White space management works excellent in ColdBox.
You could use it for your views maybe.


@Klaas-Jan Winkel

I got your point, your example could be a nice addition.

Can you put together things in a new coldbox plugin.



ColdBox 2.6.2 has update the preRender interception point to actually receive the content to be rendered. Look here:

So basically, you can just create an interceptor that executes at preRender and cleans your html to be rendered. If you do, please contribute it to the code depot.

I am not sure what removes the line breaks from the layouts in ColdBox, but it can causes issues with single-line javascript comments. Chrome gives an “Uncaught SyntaxError: Unexpected end of input”. Unless you view the source code, or experiment commenting code out it can be difficult to pin-point the cause; the error message is not very helpful.


Try to save file as UTF-8 mode. It will display extended character or it will fix the non-uni character.