The TextCollectingVisitor appears to have inconsistent behaviour with IndentedCodeBlock vs FencedCodeBlock.
The former doesn't have its text collected at all while the latter does but drops line breaks before hand.
To reproduce, run the following code using version 0.64.4:
final String markdown = "" +
"Introductory para:\n" +
"\n" +
"```\n" +
"Fenced\n" +
"```\n" +
"\n" +
" Indented\n" +
"\n";
String text = new TextCollectingVisitor().collectAndGetText(Parser.builder().build().parse(markdown));
System.out.println(text);
The surprising result of this is to print out the following, notably with Fenced coalesced onto the previous line and Indented omitted entirely:
I would expect that the TextCollectingVisitor would both pieces of text, with newlines intact:
Introductory para:
Fenced
Indented
The
TextCollectingVisitorappears to have inconsistent behaviour withIndentedCodeBlockvsFencedCodeBlock.The former doesn't have its text collected at all while the latter does but drops line breaks before hand.
To reproduce, run the following code using version 0.64.4:
The surprising result of this is to print out the following, notably with
Fencedcoalesced onto the previous line andIndentedomitted entirely:I would expect that the
TextCollectingVisitorwould both pieces of text, with newlines intact: