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

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

commit c35e61cf6119f67b992c80aa9a971a1eb6975a8d
Author: Michael Osipov <micha...@apache.org>
AuthorDate: Thu May 16 23:03:30 2024 +0200

    [DOXIA-737] [REGRESSION] Making EmitAnchorsForIndexableEntries by default 
does not extract document titles anymore
    
    This closes #214
---
 .../org/apache/maven/doxia/index/IndexingSink.java | 48 +++++++++++-----------
 1 file changed, 24 insertions(+), 24 deletions(-)

diff --git 
a/doxia-core/src/main/java/org/apache/maven/doxia/index/IndexingSink.java 
b/doxia-core/src/main/java/org/apache/maven/doxia/index/IndexingSink.java
index 2a3acebd..9554de75 100644
--- a/doxia-core/src/main/java/org/apache/maven/doxia/index/IndexingSink.java
+++ b/doxia-core/src/main/java/org/apache/maven/doxia/index/IndexingSink.java
@@ -143,30 +143,30 @@ public class IndexingSink extends 
org.apache.maven.doxia.sink.impl.SinkWrapper {
     public void text(String text, SinkEventAttributes attributes) {
         if (isTitle) {
             rootEntry.setTitle(text);
-            return;
-        }
-        switch (this.type) {
-            case SECTION_1:
-            case SECTION_2:
-            case SECTION_3:
-            case SECTION_4:
-            case SECTION_5:
-                // 
-----------------------------------------------------------------------
-                // Sanitize the id. The most important step is to remove any 
blanks
-                // 
-----------------------------------------------------------------------
-
-                // append text to current entry
-                IndexEntry entry = stack.lastElement();
-
-                String title = entry.getTitle() + text;
-                title = title.replaceAll("[\\r\\n]+", "");
-                entry.setTitle(title);
-
-                setEntryId(entry, title);
-                break;
-                // Dunno how to handle others yet
-            default:
-                break;
+        } else {
+            switch (this.type) {
+                case SECTION_1:
+                case SECTION_2:
+                case SECTION_3:
+                case SECTION_4:
+                case SECTION_5:
+                    // 
-----------------------------------------------------------------------
+                    // Sanitize the id. The most important step is to remove 
any blanks
+                    // 
-----------------------------------------------------------------------
+
+                    // append text to current entry
+                    IndexEntry entry = stack.lastElement();
+
+                    String title = entry.getTitle() + text;
+                    title = title.replaceAll("[\\r\\n]+", "");
+                    entry.setTitle(title);
+
+                    setEntryId(entry, title);
+                    break;
+                    // Dunno how to handle others yet
+                default:
+                    break;
+            }
         }
         super.text(text, attributes);
     }

Reply via email to