@@ -86,15 +86,11 @@ String render(final String rawDocComment) {
8686 private String extractDescriptionBody (final String rawDocComment ) {
8787 final String [] lines = normalize (rawDocComment ).split ("\n " , -1 );
8888 final StringBuilder body = new StringBuilder ();
89- boolean blockTagStarted = false ;
9089 int inlineTagDepth = 0 ;
9190
9291 for (String line : lines ) {
9392 if (inlineTagDepth == 0 && startsBlockTag (line )) {
94- blockTagStarted = true ;
95- }
96- if (blockTagStarted ) {
97- continue ;
93+ return trimBlankLines (body .toString ());
9894 }
9995 if (body .length () > 0 ) {
10096 body .append ('\n' );
@@ -191,6 +187,10 @@ private int renderInlineTag(final String fragment, final int start, final String
191187 "checkstyle:NPathComplexity" ,
192188 "checkstyle:ReturnCount" })
193189 private int renderHtmlTag (final String fragment , final int start , final StringBuilder rendered ) {
190+ if (start + 1 >= fragment .length () || Character .isWhitespace (fragment .charAt (start + 1 ))) {
191+ return start ;
192+ }
193+
194194 final int end = fragment .indexOf ('>' , start + 1 );
195195 if (end < 0 ) {
196196 return start ;
@@ -233,15 +233,15 @@ private int renderHtmlTag(final String fragment, final int start, final StringBu
233233 return end + 1 ;
234234 }
235235 if (CODE_TAG .equals (name )) {
236- if (!closing ) {
237- final int closingStart = findClosingTag (fragment , end + 1 , CODE_TAG );
238- if (closingStart > end ) {
239- appendCode (rendered , fragment .substring (end + 1 , closingStart ));
240- return closingStart + (CLOSING_TAG_PREFIX + CODE_TAG + HTML_TAG_END ).length ();
241- }
236+ if (closing ) {
242237 return end + 1 ;
243238 }
244- return end + 1 ;
239+ final int closingStart = findClosingTag (fragment , end + 1 , CODE_TAG );
240+ if (closingStart <= end ) {
241+ return end + 1 ;
242+ }
243+ appendCode (rendered , fragment .substring (end + 1 , closingStart ));
244+ return closingStart + (CLOSING_TAG_PREFIX + CODE_TAG + HTML_TAG_END ).length ();
245245 }
246246
247247 return end + 1 ;
@@ -253,14 +253,10 @@ private void appendLink(final StringBuilder rendered, final String payload) {
253253 }
254254
255255 final int separator = findWhitespace (payload );
256- if (separator < 0 ) {
257- rendered .append (escapeText (shortenReference (payload )));
258- return ;
259- }
260-
261- final String label = payload .substring (separator + 1 ).trim ();
256+ final String label = separator < 0 ? "" : payload .substring (separator + 1 ).trim ();
262257 if (label .isEmpty ()) {
263- rendered .append (escapeText (shortenReference (payload .substring (0 , separator ))));
258+ final String reference = separator < 0 ? payload : payload .substring (0 , separator );
259+ rendered .append (escapeText (shortenReference (reference )));
264260 return ;
265261 }
266262
0 commit comments