From 051cdfa3ccb9babc276f9c0ee913f42d5230c6b2 Mon Sep 17 00:00:00 2001 From: Ahad Birang Date: Wed, 22 Jun 2022 11:30:13 +0200 Subject: [PATCH 1/2] fix(highlight): always preload `js`, `ts` and `css` languages --- src/runtime/server/api/highlight.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/runtime/server/api/highlight.ts b/src/runtime/server/api/highlight.ts index 25692374c..f44f4c6bb 100644 --- a/src/runtime/server/api/highlight.ts +++ b/src/runtime/server/api/highlight.ts @@ -55,7 +55,11 @@ export default defineLazyEventHandler(async () => { const highlighter = await getHighlighter({ theme: theme?.default || theme || 'dark-plus', langs: [ - ...(preload || ['json', 'js', 'ts', 'css']), + ...(preload || []), + 'json', + 'js', + 'ts', + 'css', 'shell', 'html', 'md', From 3367248e515b94f76c7913ba85da9e7fc993748a Mon Sep 17 00:00:00 2001 From: Ahad Birang Date: Wed, 22 Jun 2022 11:36:37 +0200 Subject: [PATCH 2/2] chore: preload `diff` language --- src/runtime/server/api/highlight.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/runtime/server/api/highlight.ts b/src/runtime/server/api/highlight.ts index f44f4c6bb..40938a2f9 100644 --- a/src/runtime/server/api/highlight.ts +++ b/src/runtime/server/api/highlight.ts @@ -56,6 +56,7 @@ export default defineLazyEventHandler(async () => { theme: theme?.default || theme || 'dark-plus', langs: [ ...(preload || []), + 'diff', 'json', 'js', 'ts',