EmidioStani / htmlcompressor

Automatically exported from code.google.com/p/htmlcompressor
Apache License 2.0
0 stars 0 forks source link

htmlcompressor removes SSI (Server Side Includes) #43

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
htmlcompressor removes SSI from the files, so for example, if I have the 
following construct in index.html:

<!--# set var="page" value="index" -->
<!--# include file="_before.html" -->
<p>blabla</p>
<!--# include file="_after.html" --> 

It treats all the <!--# and <!-- # comments like normal other HTML comments.

There should be an exception in the htmlcompressor for comments starting with a 
'#' or 'whitespace #' to retain the SSI in the minified files.

Original issue reported on code.google.com by bart8...@gmail.com on 29 Jun 2011 at 11:16

GoogleCodeExporter commented 8 years ago
Ok, in the next release it will be added is as an option disabled by default, 
as many people use 

<!-- ######## COMMENT ####### --> 

type of comments.

Meanwhile a workaround would be to create a custom block preservation rule.

Thanks.

Original comment by serg472@gmail.com on 29 Jun 2011 at 3:18

GoogleCodeExporter commented 8 years ago
Added in 1.4 release.

Command line compressor supports --preserve-ssi option.
Java API has HtmlCompressor.SERVER_SIDE_INCLUDE_PATTERN predefined pattern that 
can be passed to setPreservePatterns() method (see front page for details).

Thanks.

Original comment by serg472@gmail.com on 8 Jul 2011 at 10:37