This is an automated email from the ASF dual-hosted git repository.
slachiewicz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-doxia.git
The following commit(s) were added to refs/heads/master by this push:
new c1734fb7 Emit the FML part anchors inside the section titles
c1734fb7 is described below
commit c1734fb7b795d602c4bea46fa4cafc3878441e87
Author: Sylwester Lachiewicz <[email protected]>
AuthorDate: Sat Nov 14 08:45:08 2026 +0000
Emit the FML part anchors inside the section titles
Sink requires sectionTitle1 to be the first element of section1; the
anchors keep their ids and now render inside the heading.
---
.../main/java/org/apache/maven/doxia/module/fml/FmlParser.java | 4 ++--
.../java/org/apache/maven/doxia/module/fml/FmlParserTest.java | 10 +++++-----
2 files changed, 7 insertions(+), 7 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 7654713a..ed629342 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
@@ -453,9 +453,9 @@ public class FmlParser extends AbstractXmlParser implements
FmlMarkup {
sink.body();
sink.section1();
+ sink.sectionTitle1();
sink.anchor("top");
sink.anchor_();
- sink.sectionTitle1();
sink.text(faqs.getTitle());
sink.sectionTitle1_();
@@ -500,9 +500,9 @@ public class FmlParser extends AbstractXmlParser implements
FmlMarkup {
for (Part part : faqs.getParts()) {
if (DoxiaStringUtils.isNotEmpty(part.getTitle())) {
sink.section1();
+ sink.sectionTitle1();
sink.anchor(part.getId());
sink.anchor_();
- sink.sectionTitle1();
xdocParser.parse(part.getTitle(), sink);
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 2fbf5cec..a26f6b82 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
@@ -103,9 +103,9 @@ class FmlParserTest extends AbstractParserTest {
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());
assertEquals("text", it.next().getName());
assertEquals("sectionTitle1_", it.next().getName());
assertEquals("paragraph", it.next().getName());
@@ -122,9 +122,9 @@ class FmlParserTest extends AbstractParserTest {
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());
assertEquals("text", it.next().getName());
assertEquals("sectionTitle1_", it.next().getName());
assertEquals("definitionList", it.next().getName());
@@ -175,9 +175,9 @@ class FmlParserTest extends AbstractParserTest {
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(), "&Α");
@@ -205,9 +205,9 @@ class FmlParserTest extends AbstractParserTest {
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(), "<");
@@ -329,9 +329,9 @@ class FmlParserTest extends AbstractParserTest {
"head_",
"body",
"section1",
+ "sectionTitle1",
"anchor",
"anchor_",
- "sectionTitle1",
"text",
"sectionTitle1_",
"numberedList",