You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2022/12/11 18:06:16 UTC

[maven-doxia] branch DOXIA-680 updated (3491d68d -> cf5858a7)

This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a change to branch DOXIA-680
in repository https://gitbox.apache.org/repos/asf/maven-doxia.git


    omit 3491d68d [DOXIA-680] Don't wrap elements in anchors
     add 3734db14 [DOXIA-681] Upgrade Plexus Utils to 3.5.0
     new cf5858a7 [DOXIA-680] Don't wrap elements in anchors

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (3491d68d)
            \
             N -- N -- N   refs/heads/DOXIA-680 (cf5858a7)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


[maven-doxia] 01/01: [DOXIA-680] Don't wrap elements in anchors

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch DOXIA-680
in repository https://gitbox.apache.org/repos/asf/maven-doxia.git

commit cf5858a7f05fca3af68b0e1fdf58ee9f3afb58e9
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Sun Dec 11 18:55:14 2022 +0100

    [DOXIA-680] Don't wrap elements in anchors
    
    This closes #130
---
 .../apache/maven/doxia/module/fml/FmlParser.java   | 14 ++++++------
 .../maven/doxia/module/fml/FmlParserTest.java      | 26 +++++++++++-----------
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/doxia-modules/doxia-module-fml/src/main/java/org/apache/maven/doxia/module/fml/FmlParser.java b/doxia-modules/doxia-module-fml/src/main/java/org/apache/maven/doxia/module/fml/FmlParser.java
index 92e0ccb2..13541ca7 100644
--- a/doxia-modules/doxia-module-fml/src/main/java/org/apache/maven/doxia/module/fml/FmlParser.java
+++ b/doxia-modules/doxia-module-fml/src/main/java/org/apache/maven/doxia/module/fml/FmlParser.java
@@ -549,10 +549,10 @@ public class FmlParser
 
         sink.body();
         sink.section1();
-        sink.sectionTitle1();
         sink.anchor( "top" );
-        sink.text( faqs.getTitle() );
         sink.anchor_();
+        sink.sectionTitle1();
+        sink.text( faqs.getTitle() );
         sink.sectionTitle1_();
 
         // ----------------------------------------------------------------------
@@ -604,11 +604,10 @@ public class FmlParser
             if ( StringUtils.isNotEmpty( part.getTitle() ) )
             {
                 sink.section1();
-
-                sink.sectionTitle1();
                 sink.anchor( part.getId() );
-                xdocParser.parse( part.getTitle(), sink );
                 sink.anchor_();
+                sink.sectionTitle1();
+                xdocParser.parse( part.getTitle(), sink );
                 sink.sectionTitle1_();
             }
 
@@ -618,8 +617,10 @@ public class FmlParser
             {
                 Faq faq = faqIterator.next();
 
-                sink.definedTerm();
                 sink.anchor( faq.getId() );
+                sink.anchor_();
+
+                sink.definedTerm();
 
                 if ( StringUtils.isNotEmpty( faq.getQuestion() ) )
                 {
@@ -630,7 +631,6 @@ public class FmlParser
                     throw new ParseException( "Missing <question> for FAQ '" + faq.getId() + "'" );
                 }
 
-                sink.anchor_();
                 sink.definedTerm_();
 
                 sink.definition();
diff --git a/doxia-modules/doxia-module-fml/src/test/java/org/apache/maven/doxia/module/fml/FmlParserTest.java b/doxia-modules/doxia-module-fml/src/test/java/org/apache/maven/doxia/module/fml/FmlParserTest.java
index e6c22128..d06b7369 100644
--- a/doxia-modules/doxia-module-fml/src/test/java/org/apache/maven/doxia/module/fml/FmlParserTest.java
+++ b/doxia-modules/doxia-module-fml/src/test/java/org/apache/maven/doxia/module/fml/FmlParserTest.java
@@ -115,10 +115,10 @@ public class FmlParserTest
         assertEquals( "head_", ( it.next() ).getName() );
         assertEquals( "body", ( it.next() ).getName() );
         assertEquals( "section1", ( it.next() ).getName() );
-        assertEquals( "sectionTitle1", ( it.next() ).getName() );
         assertEquals( "anchor", ( it.next() ).getName() );
-        assertEquals( "text", ( it.next() ).getName() );
         assertEquals( "anchor_", ( it.next() ).getName() );
+        assertEquals( "sectionTitle1", ( it.next() ).getName() );
+        assertEquals( "text", ( it.next() ).getName() );
         assertEquals( "sectionTitle1_", ( it.next() ).getName() );
         assertEquals( "paragraph", ( it.next() ).getName() );
         assertEquals( "inline", ( it.next() ).getName() );
@@ -134,16 +134,16 @@ public class FmlParserTest
         assertEquals( "numberedList_", ( it.next() ).getName() );
         assertEquals( "section1_", ( it.next() ).getName() );
         assertEquals( "section1", ( it.next() ).getName() );
-        assertEquals( "sectionTitle1", ( it.next() ).getName() );
         assertEquals( "anchor", ( it.next() ).getName() );
-        assertEquals( "text", ( it.next() ).getName() );
         assertEquals( "anchor_", ( it.next() ).getName() );
+        assertEquals( "sectionTitle1", ( it.next() ).getName() );
+        assertEquals( "text", ( it.next() ).getName() );
         assertEquals( "sectionTitle1_", ( it.next() ).getName() );
         assertEquals( "definitionList", ( it.next() ).getName() );
-        assertEquals( "definedTerm", ( it.next() ).getName() );
         assertEquals( "anchor", ( it.next() ).getName() );
-        assertEquals( "text", ( it.next() ).getName() );
         assertEquals( "anchor_", ( it.next() ).getName() );
+        assertEquals( "definedTerm", ( it.next() ).getName() );
+        assertEquals( "text", ( it.next() ).getName() );
         assertEquals( "definedTerm_", ( it.next() ).getName() );
         assertEquals( "definition", ( it.next() ).getName() );
         assertEquals( "paragraph", ( it.next() ).getName() );
@@ -189,13 +189,13 @@ public class FmlParserTest
         assertEquals( "head_", ( it.next() ).getName() );
         assertEquals( "body", ( it.next() ).getName() );
         assertEquals( "section1", ( it.next() ).getName() );
-        assertEquals( "sectionTitle1", ( it.next() ).getName() );
         assertEquals( "anchor", ( it.next() ).getName() );
+        assertEquals( "anchor_", ( it.next() ).getName() );
+        assertEquals( "sectionTitle1", ( it.next() ).getName() );
 
         // faq title TODO: should be two events
         assertTextEvent( it.next(), "&&#913;" );
 
-        assertEquals( "anchor_", ( it.next() ).getName() );
         assertEquals( "sectionTitle1_", ( it.next() ).getName() );
         assertEquals( "paragraph", ( it.next() ).getName() );
         assertEquals( "inline", ( it.next() ).getName() );
@@ -219,24 +219,24 @@ public class FmlParserTest
         assertEquals( "numberedList_", ( it.next() ).getName() );
         assertEquals( "section1_", ( it.next() ).getName() );
         assertEquals( "section1", ( it.next() ).getName() );
-        assertEquals( "sectionTitle1", ( it.next() ).getName() );
         assertEquals( "anchor", ( it.next() ).getName() );
+        assertEquals( "anchor_", ( it.next() ).getName() );
+        assertEquals( "sectionTitle1", ( it.next() ).getName() );
 
         // part title
         assertTextEvent( it.next(), "<" );
         assertTextEvent( it.next(), "\u0391" );
 
-        assertEquals( "anchor_", ( it.next() ).getName() );
         assertEquals( "sectionTitle1_", ( it.next() ).getName() );
         assertEquals( "definitionList", ( it.next() ).getName() );
-        assertEquals( "definedTerm", ( it.next() ).getName() );
         assertEquals( "anchor", ( it.next() ).getName() );
+        assertEquals( "anchor_", ( it.next() ).getName() );
+        assertEquals( "definedTerm", ( it.next() ).getName() );
 
         // question
         assertTextEvent( it.next(), ">" );
         assertTextEvent( it.next(), "\u0391" );
 
-        assertEquals( "anchor_", ( it.next() ).getName() );
         assertEquals( "definedTerm_", ( it.next() ).getName() );
         assertEquals( "definition", ( it.next() ).getName() );
         assertEquals( "paragraph", ( it.next() ).getName() );
@@ -289,7 +289,7 @@ public class FmlParserTest
             content = IOUtil.toString( reader );
         }
 
-        assertTrue( content.contains( "<a id=\"macro-definition\">Macro Question</a>" ) );
+        assertTrue( content.contains( "<a id=\"macro-definition\"></a>" + EOL + "<dt>Macro Question</dt>" ) );
     }
 
     private void assertTextEvent( SinkEventElement textEvt, String string )