Skip to content

Commit 8ebd7db

Browse files
committed
Correctly handle text when highlighting
Resolves #2610
1 parent 3595873 commit 8ebd7db

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Unreleased
22

3+
### Bug Fixes
4+
5+
- The `text` non-highlighted language no longer causes warnings when rendering, #2610.
6+
37
## v0.26.1 (2024-06-22)
48

59
### Features

src/lib/utils/highlighter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ export function getSupportedThemes(): string[] {
157157
}
158158

159159
export function isLoadedLanguage(lang: string): boolean {
160-
return highlighter?.supports(lang) ?? false;
160+
return lang === "text" || (highlighter?.supports(lang) ?? false);
161161
}
162162

163163
export function highlight(code: string, lang: string): string {

0 commit comments

Comments
 (0)