|
|
@ -1,7 +1,7 @@
|
|
|
|
import { customAlphabet } from 'nanoid'
|
|
|
|
import { customAlphabet } from 'nanoid'
|
|
|
|
import c from 'picocolors'
|
|
|
|
import c from 'picocolors'
|
|
|
|
import type { ShikiTransformer } from 'shiki'
|
|
|
|
import type { ShikiTransformer } from 'shiki'
|
|
|
|
import { bundledLanguages, getHighlighter, isSpecialLang } from 'shiki'
|
|
|
|
import { bundledLanguages, createHighlighter, isSpecialLang } from 'shiki'
|
|
|
|
import {
|
|
|
|
import {
|
|
|
|
transformerCompactLineOptions,
|
|
|
|
transformerCompactLineOptions,
|
|
|
|
transformerNotationDiff,
|
|
|
|
transformerNotationDiff,
|
|
|
@ -57,7 +57,7 @@ export async function highlight(
|
|
|
|
codeTransformers: userTransformers = []
|
|
|
|
codeTransformers: userTransformers = []
|
|
|
|
} = options
|
|
|
|
} = options
|
|
|
|
|
|
|
|
|
|
|
|
const highlighter = await getHighlighter({
|
|
|
|
const highlighter = await createHighlighter({
|
|
|
|
themes:
|
|
|
|
themes:
|
|
|
|
typeof theme === 'object' && 'light' in theme && 'dark' in theme
|
|
|
|
typeof theme === 'object' && 'light' in theme && 'dark' in theme
|
|
|
|
? [theme.light, theme.dark]
|
|
|
|
? [theme.light, theme.dark]
|
|
|
|