1
0
mirror of https://github.com/mrclay/minify.git synced 2025-08-21 13:21:59 +02:00

Exclude SSI Comments (#670)

* Exclude SSI comments

Exclude Nginx & Apache Server Side Include (SSI) comments from being stripped via minification, the same way IE directives are not stripped.

Both Nginx & Apache SSI directives begin with:

<!—#

So we can just look for the # and don’t strip the comment in that case.

Nginx SSI: http://nginx.org/en/docs/http/ngx_http_ssi_module.html

Apache SSI: https://httpd.apache.org/docs/2.4/howto/ssi.html

* Add tests for Nginx/Apache SSI directives

Co-authored-by: Andrew Welch <andrew@keluli.local>
This commit is contained in:
Andrew Welch
2020-04-02 15:45:11 -04:00
committed by GitHub
parent d2a3e8c1d2
commit 0f607be23a
5 changed files with 29 additions and 9 deletions

View File

@@ -9,6 +9,11 @@
<meta name="description" content="A demonstration of what can be accomplished visually through CSS-based design." />
<meta name="robots" content="all" />
<title>css Zen Garden: The Beauty in CSS Design</title>
<!--# if expr="$HTTP_COOKIE=/minify\=1/" -->
<meta name="generator" content="minify-cookie" />
<!--# else -->
<meta name="generator" content="minify-no-cookie" />
<!--# endif -->
<!-- to correct the unsightly Flash of Unstyled Content. http://www.bluerobot.com/web/css/fouc.asp -->
<script type="text/javascript"><!--
@@ -63,11 +68,11 @@ css hack {
display:none;
}
</style>
<link
<link
rel="Shortcut Icon"
type="image/x-icon"
href="http://www.csszengarden.com/favicon.ico" />
<link
<link
rel="alternate"
type="application/rss+xml"
title="RSS"
@@ -78,7 +83,7 @@ css hack {
<div id="container">
<div id="pageHeader">
<h1><span>css Zen Garden</span></h1>
<h2><span>The Beauty of <acronym title="Cascading Style Sheets">CSS</acronym>
<h2><span>The Beauty of <acronym title="Cascading Style Sheets">CSS</acronym>
Design</span></h2>
</div>
<pre>