Skip to content

Commit

Permalink
Fix crash when highlighting unsupported languages
Browse files Browse the repository at this point in the history
Resolves #2609
  • Loading branch information
Gerrit0 committed Jun 22, 2024
1 parent e9bd40b commit f031595
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- Anchor links are no longer incorrectly checked for relative paths, #2604.
- Fixed an issue where line numbers reported in error messages could be incorrect, #2605.
- Fixed relative link detection for markdown links containing code in their label, #2606.
- TypeDoc will no longer crash when asked to render highlighted code for an unsupported language, #2609.

### Thanks!

Expand Down
2 changes: 1 addition & 1 deletion src/lib/output/themes/MarkedPlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ export class MarkedPlugin extends ContextAwareRendererComponent {
this.parser = markdown({
...this.markdownItOptions,
highlight: (code, lang) => {
code = highlight(code, lang || "ts");
code = this.getHighlighted(code, lang || "ts");
code = code.replace(/\n$/, "") + "\n";

if (!lang) {
Expand Down

0 comments on commit f031595

Please sign in to comment.