Skip to content

Commit

Permalink
Fix not showing empty lines in code snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
NipunaMadhushan committed Jan 31, 2025
1 parent a6e4f99 commit f653ae5
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,11 @@ private static String getDocCodeBlockString(MarkdownCodeBlockNode markdownCodeBl
markdownCodeBlockNode.langAttribute().ifPresent(langAttribute -> doc.append(langAttribute));

for (MarkdownCodeLineNode codeLineNode : markdownCodeBlockNode.codeLines()) {
doc.append(codeLineNode.codeDescription().toString());
if (codeLineNode.codeDescription().toString().isEmpty()) {
doc.append("\n");
} else {
doc.append(codeLineNode.codeDescription().toString());
}
}

doc.append(markdownCodeBlockNode.endBacktick().toString());
Expand Down

0 comments on commit f653ae5

Please sign in to comment.