Comparing version 2.0.0 to 2.0.1
{ | ||
"name": "repo2pdf", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "A Node.js utility for generating a PDF document from a GitHub repository", | ||
@@ -5,0 +5,0 @@ "main": "dist/clone.js", |
@@ -361,9 +361,13 @@ #!/usr/bin/env node | ||
try { | ||
highlightedCode = hljs.highlight(data, { | ||
language: addHighlighting ? extension : "plaintext", | ||
}).value | ||
// Check if language is supported before attempting to highlight | ||
if (addHighlighting && hljs.getLanguage(extension)) { | ||
highlightedCode = hljs.highlight(data, { language: extension }).value | ||
} else { | ||
// Use plaintext highlighting if language is not supported | ||
highlightedCode = hljs.highlight(data, { language: "plaintext" }).value | ||
} | ||
} catch (error) { | ||
highlightedCode = hljs.highlight(data, { | ||
language: "plaintext", | ||
}).value | ||
console.error(`Error highlighting code: ${error}`) | ||
// Use plaintext highlighting if an error occurs | ||
highlightedCode = hljs.highlight(data, { language: "plaintext" }).value | ||
} | ||
@@ -370,0 +374,0 @@ const hlData = htmlToJson(highlightedCode) |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
63433
1097
0