o Clarified that makeHtmlValid() outputs XHTML

git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@654900 13f79535-47bb-0310-9956-ffa450edef68
master
Benjamin Bentmann 2008-05-09 18:03:38 +00:00
parent ebd246bba0
commit 9d4feb3021
2 changed files with 8 additions and 2 deletions

View File

@ -233,8 +233,10 @@ public final class PluginUtils
}
/**
* @param description Javadoc description with HTML tags
* @return the description with valid HTML tags
* Fixes some javadoc comment to become a valid XHTML snippet.
*
* @param description Javadoc description with HTML tags, may be <code>null</code>.
* @return The description with valid XHTML tags, never <code>null</code>.
*/
public static String makeHtmlValid( String description )
{

View File

@ -132,6 +132,10 @@ public class PluginUtilsTest
javadoc = "Generates <i>something</i> <b> for the project.";
assertEquals( "Generates <i>something</i> <b> for the project.</b>", PluginUtils.makeHtmlValid( javadoc ) );
// wrong XHTML
javadoc = "Line1<br>Line2";
assertEquals( "Line1<br/>Line2", PluginUtils.makeHtmlValid( javadoc ).replaceAll( "\\s", "" ) );
// special characters
javadoc = "& &amp; < > \u00A0";
assertEquals( "&amp; &amp; &lt; &gt; \u00A0", PluginUtils.makeHtmlValid( javadoc ) );