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 2023/01/06 20:56:22 UTC

[maven-project-info-reports-plugin] branch master updated: [MPIR-425] Verbatim content should be rendered as plain text

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

michaelo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-project-info-reports-plugin.git


The following commit(s) were added to refs/heads/master by this push:
     new dee3a29  [MPIR-425] Verbatim content should be rendered as plain text
dee3a29 is described below

commit dee3a29c0248c497a9229043490b70cac17b8c12
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Fri Jan 6 21:54:35 2023 +0100

    [MPIR-425] Verbatim content should be rendered as plain text
---
 .../projectinfo/AbstractProjectInfoRenderer.java   | 36 ++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/src/main/java/org/apache/maven/report/projectinfo/AbstractProjectInfoRenderer.java b/src/main/java/org/apache/maven/report/projectinfo/AbstractProjectInfoRenderer.java
index 90d9cbc..26ea74b 100644
--- a/src/main/java/org/apache/maven/report/projectinfo/AbstractProjectInfoRenderer.java
+++ b/src/main/java/org/apache/maven/report/projectinfo/AbstractProjectInfoRenderer.java
@@ -105,5 +105,41 @@ public abstract class AbstractProjectInfoRenderer
         }
     }
 
+    /* FIXME The next two methods need to be retained until Doxia and Maven Reporting Impl properly implement
+     * the difference of a (boxed) real verbatim text and (boxed) source code.
+     */
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected void verbatimText( String text )
+    {
+        sink.verbatim( null );
+
+        text( text );
+
+        sink.verbatim_();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected void verbatimLink( String text, String href )
+    {
+        if ( StringUtils.isEmpty( href ) )
+        {
+            verbatimText( text );
+        }
+        else
+        {
+            sink.verbatim( null );
+
+            link( href, text );
+
+            sink.verbatim_();
+        }
+    }
+
     protected abstract String getI18Nsection();
 }