Details
-
Bug
-
Status: Closed
-
Trivial
-
Resolution: Fixed
-
1.8.2, 1.9-beta-3
-
None
-
Patch
Description
The Method summary block of the groovydoc pages contains a sentence describing the method.
However, if the javadoc looks like (taken from StreamingJsonBuilder.groovy):
/** * Varargs elements as arguments to the JSON builder create a root JSON array * <p> * Example: * <pre class="groovyTestCase"> * new StringWriter().with { w -> * def json = new groovy.json.StreamingJsonBuilder( w ) * def result = json 1, 2, 3 * * assert result instanceof List * assert w.toString() == "[1,2,3]" * } * </pre> * @param args an array of values * @return a list of values */
Then the summary text becomes:
Varargs elements as arguments to the JSON builder create a root JSON array Example: new StringWriter().with { w -> def json = new groovy.json.StreamingJsonBuilder( w ) def result = json 1, 2, 3
In this case, it is only confusing (as the assert is missed off the end, but in other cases, it could result in invalid code being shown in the summary.
The attached patch adds another replaceAll to the calculateFirstSentence method of SimpleGroovyDoc.java which trims the javadoc as soon as an HTML tag is encountered as the first thing on a new line in the javadoc.
The summary text for this same method then becomes simply:
Varargs elements as arguments to the JSON builder create a root JSON array