1
1
mirror of https://github.com/theoludwig/theoludwig.git synced 2025-05-29 22:37:44 +02:00

fix: remove vercel cli + update dependencies to latest

This commit is contained in:
2023-07-14 23:50:20 +02:00
parent 117c41b1c3
commit bc719578d2
8 changed files with 1069 additions and 7226 deletions

View File

@@ -1,5 +1,5 @@
import type { Plugin, Transformer } from 'unified'
import type { Literal } from 'unist'
import type { Literal, Node } from 'unist'
import { visit } from 'unist-util-visit'
import type { Highlighter } from 'shiki'
@@ -7,15 +7,17 @@ export interface RemarkSyntaxHighlightingPluginOptions {
highlighter: Highlighter
}
export type RemarkSyntaxHighlightingNode = Literal<string> & {
export interface RemarkSyntaxHighlightingNode extends Node {
lang: string
meta: string
children: undefined
value: string
data: Record<string, unknown>
}
export const remarkSyntaxHighlightingPlugin: Plugin<
[RemarkSyntaxHighlightingPluginOptions],
Literal<string, RemarkSyntaxHighlightingNode>
Literal
> = (options) => {
const transformer: Transformer<RemarkSyntaxHighlightingNode> = (tree) => {
visit<RemarkSyntaxHighlightingNode, string>(tree, 'code', (node) => {