Skip to content

Commit

Permalink
Correctly handle text when highlighting
Browse files Browse the repository at this point in the history
Resolves #2610
  • Loading branch information
Gerrit0 committed Jun 23, 2024
1 parent 3595873 commit 8ebd7db
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Unreleased

### Bug Fixes

- The `text` non-highlighted language no longer causes warnings when rendering, #2610.

## v0.26.1 (2024-06-22)

### Features
Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils/highlighter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export function getSupportedThemes(): string[] {
}

export function isLoadedLanguage(lang: string): boolean {
return highlighter?.supports(lang) ?? false;
return lang === "text" || (highlighter?.supports(lang) ?? false);
}

export function highlight(code: string, lang: string): string {
Expand Down

0 comments on commit 8ebd7db

Please sign in to comment.