Skip to content

Commit 52676c2

Browse files
committed
[fix] Resolve inner classes broken links per #236
1 parent d928195 commit 52676c2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/main/groovy/org/codehaus/mojo/spotbugs/SpotbugsReportGenerator.groovy

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ package org.codehaus.mojo.spotbugs
2121

2222
import groovy.xml.slurpersupport.GPathResult
2323

24+
import org.apache.maven.doxia.markup.HtmlMarkup
2425
import org.apache.maven.doxia.sink.Sink
26+
import org.apache.maven.doxia.sink.SinkEventAttributes
27+
import org.apache.maven.doxia.sink.impl.SinkEventAttributeSet
2528
import org.apache.maven.doxia.tools.SiteTool
2629
import org.apache.maven.plugin.logging.Log
2730

@@ -502,8 +505,10 @@ class SpotbugsReportGenerator implements SpotBugsInfo {
502505

503506
log.debug("Opening Class Report Section")
504507

505-
sink.anchor(bugClass)
506-
sink.anchor_()
508+
// Dollar '$' for nested classes is not valid character in sink.anchor() and therefore it is ignored
509+
// https://github.com/spotbugs/spotbugs-maven-plugin/issues/236
510+
sink.unknown(HtmlMarkup.A.toString(), new Object[] { HtmlMarkup.TAG_TYPE_START }, new SinkEventAttributeSet(SinkEventAttributes.NAME, bugClass));
511+
sink.unknown(HtmlMarkup.A.toString(), new Object[] { HtmlMarkup.TAG_TYPE_END }, null);
507512

508513
sink.section2()
509514
sink.sectionTitle2()

0 commit comments

Comments
 (0)