cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From =?us-ascii?Q?Nicol=E1s?= Lichtmaier <n...@debian.org>
Subject [C1] [patch] The cocoon "advertising" shouldn't be in documents which don't allow it
Date Thu, 22 Feb 2001 02:50:24 GMT
 There are many text/* content types that doesn't accept <!--  markup as a
comment. The default should be to do nothing, and to only add markup if we
positively know it will be ignored.

 I've added an allowsMarkup() method to the Page class. If you know other
common content-types which allow markup, please include them (does XHTML use
another one?).

Index: Engine.java
===================================================================
RCS file: /home/cvspublic/xml-cocoon/src/org/apache/cocoon/Engine.java,v
retrieving revision 1.50
diff -u -r1.50 Engine.java
--- Engine.java	2001/01/24 15:52:22	1.50
+++ Engine.java	2001/02/22 02:38:50
@@ -467,7 +467,7 @@
                 // if verbose mode is on, the output type allows it
                 // and the HTTP request isn't a HEAD
                 // print some processing info as a comment
-                if (VERBOSE && (page.isText()) && !"HEAD".equals(request.getMethod()))
{
+                if (VERBOSE && (page.allowsMarkup()) && !"HEAD".equals(request.getMethod()))
{
                     time = System.currentTimeMillis() - time;
                     String comment = "\n<!-- This page was served "
                         + (wasInCache ? "from cache " : "")
Index: framework/Page.java
===================================================================
RCS file: /home/cvspublic/xml-cocoon/src/org/apache/cocoon/framework/Page.java,v
retrieving revision 1.6
diff -u -r1.6 Page.java
--- framework/Page.java	2000/12/22 11:51:08	1.6
+++ framework/Page.java	2001/02/22 02:38:50
@@ -89,6 +89,13 @@
     	return this.contentType.startsWith("text");
     }
     
+    public boolean allowsMarkup() {
+        return contentType.equals("text/xml")
+	        || contentType.equals("text/html")
+	        || contentType.equals("text/svg")
+	        || contentType.equals("text/mathml");
+    }
+    
     public Enumeration getChangeables() {
         return this.changeables.elements();
     }

Mime
View raw message