full site update
This commit is contained in:
20
node_modules/astro/components/Code.astro
generated
vendored
20
node_modules/astro/components/Code.astro
generated
vendored
@@ -1,15 +1,9 @@
|
||||
---
|
||||
import type { ThemePresets } from '@astrojs/markdown-remark';
|
||||
import type {
|
||||
BuiltinLanguage,
|
||||
LanguageRegistration,
|
||||
ShikiTransformer,
|
||||
SpecialLanguage,
|
||||
ThemeRegistration,
|
||||
ThemeRegistrationRaw,
|
||||
} from 'shiki';
|
||||
import type { ShikiTransformer, ThemeRegistration, ThemeRegistrationRaw } from 'shiki';
|
||||
import { bundledLanguages } from 'shiki/langs';
|
||||
import { getCachedHighlighter } from '../dist/core/shiki.js';
|
||||
import type { CodeLanguage } from '../dist/types/public';
|
||||
import type { HTMLAttributes } from '../types';
|
||||
|
||||
interface Props extends Omit<HTMLAttributes<'pre'>, 'lang'> {
|
||||
@@ -22,7 +16,7 @@ interface Props extends Omit<HTMLAttributes<'pre'>, 'lang'> {
|
||||
*
|
||||
* @default "plaintext"
|
||||
*/
|
||||
lang?: BuiltinLanguage | SpecialLanguage | LanguageRegistration;
|
||||
lang?: CodeLanguage;
|
||||
/**
|
||||
* A metastring to pass to the highlighter.
|
||||
* Allows passing information to transformers: https://shiki.style/guide/transformers#meta
|
||||
@@ -111,13 +105,13 @@ const highlighter = await getCachedHighlighter({
|
||||
],
|
||||
theme,
|
||||
themes,
|
||||
defaultColor,
|
||||
wrap,
|
||||
transformers,
|
||||
});
|
||||
|
||||
const html = await highlighter.highlight(code, typeof lang === 'string' ? lang : lang.name, {
|
||||
const html = await highlighter.codeToHtml(code, typeof lang === 'string' ? lang : lang.name, {
|
||||
defaultColor,
|
||||
wrap,
|
||||
inline,
|
||||
transformers,
|
||||
meta,
|
||||
attributes: rest as any,
|
||||
});
|
||||
|
Reference in New Issue
Block a user