]> granicus.if.org Git - apache/commitdiff
Add the <!--#comment ... --> syntax.
authorChristophe Jaillet <jailletc36@apache.org>
Sat, 2 Apr 2016 08:53:35 +0000 (08:53 +0000)
committerChristophe Jaillet <jailletc36@apache.org>
Sat, 2 Apr 2016 08:53:35 +0000 (08:53 +0000)
Idea from Rob.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1737476 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
docs/manual/mod/mod_include.xml
modules/filters/mod_include.c

diff --git a/CHANGES b/CHANGES
index 480941c61abb9bd9c12cdd09ae07cac9610ced0c..9d4232fb387ab5f6cf217940d1ca4f35bace103b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) mod_include: add the <!--#comment ...> syntax in order to include comments
+     in a SSI file. [Christophe Jaillet based on a suggestion from Rob]
+
   *) mpm_event, mpm_worker: Fix computation of MinSpareThreads' lower bound
      according the number of listeners buckets.  [Yann Ylavic]
 
index 50f84b046563b30eb8f5f941fb6c596954d94cb7..5ede805f95bd8956bd589255ca35738a3f8251cd 100644 (file)
@@ -110,6 +110,8 @@ AddOutputFilter INCLUDES .shtml
 
     <table border="1">
     <tr><th>Element</th><th>Description</th></tr>
+    <tr><td><code><a href="#element.comment">comment</a></code></td>
+        <td>SSI comment</td></tr>
     <tr><td><code><a href="#element.config">config</a></code></td>
         <td>configure output formats</td></tr>
     <tr><td><code><a href="#element.echo">echo</a></code></td>
@@ -134,6 +136,17 @@ AddOutputFilter INCLUDES .shtml
     <module>mod_cgi</module>, and will only be available if this
     module is loaded.</p>
 
+    <section id="element.comment"><title>The comment Element</title>
+      <p>This command doesn't output anything. Its only use is to
+      add comments within a file. These comments are not printed.</p>
+
+      <p>This syntax is available in version 2.5 and later.</p>
+
+      <example>
+      &lt;!--#comment Blah Blah Blah --&gt;
+      </example>
+    </section> <!-- /comment -->
+
     <section id="element.config"><title>The config Element</title>
       <p>This command controls various aspects of the parsing. The
       valid attributes are:</p>
index e73b762f94b869fc1cfc0d8a43f051da6cf9c194..6bd85e7fe0db45c2f5a1d0fe9ec8d2b6a9cf8735 100644 (file)
@@ -1763,6 +1763,15 @@ static int find_file(request_rec *r, const char *directive, const char *tag,
     }
 }
 
+/*
+ * <!--#comment blah blah blah ... -->
+ */
+static apr_status_t handle_comment(include_ctx_t *ctx, ap_filter_t *f,
+                                   apr_bucket_brigade *bb)
+{
+    return APR_SUCCESS;
+}
+
 /*
  * <!--#include virtual|file="..." [onerror|virtual|file="..."] ... -->
  *
@@ -4161,6 +4170,7 @@ static int include_post_config(apr_pool_t *p, apr_pool_t *plog,
         ssi_pfn_register("endif", handle_endif);
         ssi_pfn_register("fsize", handle_fsize);
         ssi_pfn_register("config", handle_config);
+        ssi_pfn_register("comment", handle_comment);
         ssi_pfn_register("include", handle_include);
         ssi_pfn_register("flastmod", handle_flastmod);
         ssi_pfn_register("printenv", handle_printenv);