Skip to content

Commit

Permalink
fix(highlighter): missing highlights
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Sep 13, 2023
1 parent 46e7839 commit c5633c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/runtime/shiki/event-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default lazyEventHandler(async () => {
return eventHandler(async (event) => {
const { code, lang, theme: themeString, highlights: highlightsString } = getQuery(event)
const theme = JSON.parse(themeString as string)
const highlights = JSON.parse(highlightsString as string) as number[]
const highlights = highlightsString ? JSON.parse(highlightsString as string) as number[] : undefined

return await shiki.getHighlightedAST(code as string, lang as BuiltinLanguage, theme as BuiltinTheme, { highlights })
})
Expand Down

0 comments on commit c5633c3

Please sign in to comment.