Author: vsiveton
Date: Sat Jan 27 05:17:07 2007
New Revision: 500527

URL: http://svn.apache.org/viewvc?view=rev&rev=500527
Log:
DOXIA-96: Doxia xdoc chokes on macros and pushes </macro> to the output
Submitted by: Henning Schmiedehausen 
Reviewed by: Vincent Siveton

o Applied patch in doxia-core
o Add a test case in site-render

Added:
    maven/doxia/trunk/doxia-site-renderer/src/test/site/xdoc/macro.xml   (with 
props)
Modified:
    
maven/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/module/xdoc/XdocParser.java
    
maven/doxia/trunk/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/DefaultSiteRendererTest.java

Modified: 
maven/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/module/xdoc/XdocParser.java
URL: 
http://svn.apache.org/viewvc/maven/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/module/xdoc/XdocParser.java?view=diff&rev=500527&r1=500526&r2=500527
==============================================================================
--- 
maven/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/module/xdoc/XdocParser.java
 (original)
+++ 
maven/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/module/xdoc/XdocParser.java
 Sat Jan 27 05:17:07 2007
@@ -278,6 +278,10 @@
                     // TODO: Note there will be badness if link_ != anchor != 
</a>
                     sink.link_();
                 }
+                else if ( parser.getName().equals( "macro" ) )
+                {
+                    //Do nothing
+                }
 
                 // 
----------------------------------------------------------------------
                 // Tables

Modified: 
maven/doxia/trunk/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/DefaultSiteRendererTest.java
URL: 
http://svn.apache.org/viewvc/maven/doxia/trunk/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/DefaultSiteRendererTest.java?view=diff&rev=500527&r1=500526&r2=500527
==============================================================================
--- 
maven/doxia/trunk/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/DefaultSiteRendererTest.java
 (original)
+++ 
maven/doxia/trunk/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/DefaultSiteRendererTest.java
 Sat Jan 27 05:17:07 2007
@@ -29,6 +29,7 @@
 import org.apache.maven.doxia.site.decoration.io.xpp3.DecorationXpp3Reader;
 import org.codehaus.plexus.PlexusTestCase;
 import org.codehaus.plexus.util.FileUtils;
+import org.codehaus.plexus.util.IOUtil;
 
 import com.gargoylesoftware.htmlunit.WebClient;
 import com.gargoylesoftware.htmlunit.html.HtmlAnchor;
@@ -110,6 +111,7 @@
         verifyCdcPage();
         verifyNestedItemsPage();
         verifyMultipleBlock();
+        verifyMacro();
     }
 
     /**
@@ -485,5 +487,19 @@
         assertEquals( li.getFirstChild().asText(), "list1" );
 
         assertFalse( elementIterator.hasNext() );
+    }
+
+    /**
+     * @throws Exception
+     */
+    public void verifyMacro()
+        throws Exception
+    {
+        File macro = getTestFile( "target/output/macro.html" );
+        assertNotNull( macro );
+        assertTrue( macro.exists() );
+
+        String content = IOUtil.toString( new FileReader( macro ) );
+        assertEquals( content.indexOf( "</macro>" ), -1 );
     }
 }

Added: maven/doxia/trunk/doxia-site-renderer/src/test/site/xdoc/macro.xml
URL: 
http://svn.apache.org/viewvc/maven/doxia/trunk/doxia-site-renderer/src/test/site/xdoc/macro.xml?view=auto&rev=500527
==============================================================================
--- maven/doxia/trunk/doxia-site-renderer/src/test/site/xdoc/macro.xml (added)
+++ maven/doxia/trunk/doxia-site-renderer/src/test/site/xdoc/macro.xml Sat Jan 
27 05:17:07 2007
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<document>
+  <properties>
+    <title>Test DOXIA-96</title>
+    <author email="[EMAIL PROTECTED]">Vincent Siveton</author>
+  </properties>
+  <body>
+    <section name="section name">
+      <macro name="snippet" id="superpom" 
url="http://svn.apache.org/repos/asf/maven/components/trunk/maven-project/src/main/resources/org/apache/maven/project/pom-4.0.0.xml"/>
+    </section>
+  </body>
+</document>

Propchange: maven/doxia/trunk/doxia-site-renderer/src/test/site/xdoc/macro.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/doxia/trunk/doxia-site-renderer/src/test/site/xdoc/macro.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"


Reply via email to