@Override public Void visitDocComment(DocCommentTree node, Void v) { v = scan(node.getFirstSentence(), v); List<? extends DocTree> body = node.getBody(); if (body.size() > 0) { writer.append("\n\n"); writer.resetParagraph(); v = scan(body, v); } List<? extends DocTree> blockTags = node.getBlockTags(); if (blockTags.size() > 0) { writer.append("\n"); v = scan(blockTags, v); } return v; }
@Test public void testResetParagraph() throws IOException { DocWriter writer = new DocWriter(); writer.write("abc\n def\n"); writer.resetParagraph(); writer.write("ghi\n jkl"); assertEquals("abc\ndef\nghi\njkl", writer.render()); }