mirror of https://github.com/apache/maven.git
PR: MNG-706
Submitted by: Siveton Vincent Reviewed by: Emmanuel Venisse Comment: Correct the API to handle correctly the javadoc as HTML; Updated getValidHref() to handle relative path. git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@291668 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
eaf9a7ef0e
commit
c6a140e1ae
|
@ -189,10 +189,29 @@ public abstract class AbstractMavenReportRenderer
|
||||||
* @see #linkPatternedText(String)
|
* @see #linkPatternedText(String)
|
||||||
*/
|
*/
|
||||||
protected void tableCell( String text )
|
protected void tableCell( String text )
|
||||||
|
{
|
||||||
|
tableCell( text, false );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a cell in a table.
|
||||||
|
* <p>If <code>asHtml</code> is true, add the text as Html</p>
|
||||||
|
*
|
||||||
|
* @param text
|
||||||
|
* @param asHtml
|
||||||
|
*/
|
||||||
|
protected void tableCell( String text, boolean asHtml )
|
||||||
{
|
{
|
||||||
sink.tableCell();
|
sink.tableCell();
|
||||||
|
|
||||||
linkPatternedText( text );
|
if ( asHtml )
|
||||||
|
{
|
||||||
|
sink.rawText( text );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
linkPatternedText( text );
|
||||||
|
}
|
||||||
|
|
||||||
sink.tableCell_();
|
sink.tableCell_();
|
||||||
}
|
}
|
||||||
|
@ -224,7 +243,9 @@ public abstract class AbstractMavenReportRenderer
|
||||||
protected void tableCaption( String caption )
|
protected void tableCaption( String caption )
|
||||||
{
|
{
|
||||||
sink.tableCaption();
|
sink.tableCaption();
|
||||||
|
|
||||||
text( caption );
|
text( caption );
|
||||||
|
|
||||||
sink.tableCaption_();
|
sink.tableCaption_();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -422,7 +443,8 @@ public abstract class AbstractMavenReportRenderer
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a valid href.
|
* Return a valid href.
|
||||||
* <p>A valid href could start by <code>mailto:</code></p>.
|
* <p>A valid href could start by <code>mailto:</code>.</p>
|
||||||
|
* <p>For a relative path, the href should start by <code>./</code> to be valid.</p>
|
||||||
*
|
*
|
||||||
* @param href an href
|
* @param href an href
|
||||||
* @return a valid href or null if the href is not valid.
|
* @return a valid href or null if the href is not valid.
|
||||||
|
@ -451,7 +473,7 @@ public abstract class AbstractMavenReportRenderer
|
||||||
// TODO Waiting for new release of Validator
|
// TODO Waiting for new release of Validator
|
||||||
// http://issues.apache.org/bugzilla/show_bug.cgi?id=30686
|
// http://issues.apache.org/bugzilla/show_bug.cgi?id=30686
|
||||||
String hrefTmp;
|
String hrefTmp;
|
||||||
if ( !href.trim().endsWith( "/" ) )
|
if ( !href.endsWith( "/" ) )
|
||||||
{
|
{
|
||||||
hrefTmp = href + "/index.html";
|
hrefTmp = href + "/index.html";
|
||||||
}
|
}
|
||||||
|
@ -465,6 +487,18 @@ public abstract class AbstractMavenReportRenderer
|
||||||
return href;
|
return href;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( href.startsWith( "./" ) )
|
||||||
|
{
|
||||||
|
if ( href.length() > 2 )
|
||||||
|
{
|
||||||
|
return href.substring(2, href.length() );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return ".";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue