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/07/27 16:13:12 UTC

[maven-doxia] branch DOXIA-665 created (now 68eb54ee)

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

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


      at 68eb54ee [DOXIA-665] Add anchors around FML parts

This branch includes the following new commits:

     new 68eb54ee [DOXIA-665] Add anchors around FML parts

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.



[maven-doxia] 01/01: [DOXIA-665] Add anchors around FML parts

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

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

commit 68eb54ee848a4751c31027b3eaea3bbffc2a01dd
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Wed Jul 27 18:12:45 2022 +0200

    [DOXIA-665] Add anchors around FML parts
---
 .../src/main/java/org/apache/maven/doxia/module/fml/FmlParser.java    | 2 ++
 .../test/java/org/apache/maven/doxia/module/fml/FmlParserTest.java    | 4 ++++
 2 files changed, 6 insertions(+)

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 52f34e8b..70cb8a43 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
@@ -606,7 +606,9 @@ public class FmlParser
                 sink.section1();
 
                 sink.sectionTitle1();
+                sink.anchor( part.getId() );
                 xdocParser.parse( part.getTitle(), sink );
+                sink.anchor_();
                 sink.sectionTitle1_();
             }
 
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 eeaab5ae..7d9457df 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
@@ -135,7 +135,9 @@ public class FmlParserTest
         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( "definitionList", ( it.next() ).getName() );
         assertEquals( "definedTerm", ( it.next() ).getName() );
@@ -218,11 +220,13 @@ public class FmlParserTest
         assertEquals( "section1_", ( it.next() ).getName() );
         assertEquals( "section1", ( it.next() ).getName() );
         assertEquals( "sectionTitle1", ( it.next() ).getName() );
+        assertEquals( "anchor", ( 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() );