Skip to content

Commit

Permalink
fix: sentinel is a known language (#2451)
Browse files Browse the repository at this point in the history
* fix: sentinel is a known language

* fix: don't log error on `text`
  • Loading branch information
dstaley authored May 16, 2024
1 parent 8de60a6 commit fbc05a0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/lib/rehype-code-plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,13 @@ export const rehypeCodePlugins: Pluggable[] = [
}

// Finally, if the language is still unknown, default
// to plaintext.
if (!defaultShikiOptions.langs.includes(options.lang)) {
// to plaintext, unless the language is explicitly set
// to `sentinel`, which is in `langs` as an object.
if (
!defaultShikiOptions.langs.includes(options.lang) &&
options.lang !== 'sentinel' &&
options.lang !== 'text'
) {
console.error(
`ShikiError: Language \`${options.lang}\` not found, you may need to load it first`
)
Expand Down

0 comments on commit fbc05a0

Please sign in to comment.