We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 780d3d2 commit d2a4046Copy full SHA for d2a4046
src/theme/CodeBlock/index.js
@@ -4,6 +4,8 @@ import CodeViewer from "../../components/CodeViewer";
4
5
6
function countLines(text) {
7
+ // Handle undefined or null input
8
+ if (!text) return 1; // Return 1 as default line count
9
// Split the string by newline characters
10
const lines = text.split('\n');
11
// Return the number of lines
0 commit comments