From 1af103d29e4c1e37533a85cc6f3f8333ca16eb2a Mon Sep 17 00:00:00 2001 From: Jay V Date: Tue, 15 Jul 2025 17:47:18 -0400 Subject: [PATCH] docs: share handle non bundled langs --- packages/web/src/components/share/content-code.tsx | 4 ++-- packages/web/src/components/share/part.module.css | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/web/src/components/share/content-code.tsx b/packages/web/src/components/share/content-code.tsx index 72352d1e9..2f383b8be 100644 --- a/packages/web/src/components/share/content-code.tsx +++ b/packages/web/src/components/share/content-code.tsx @@ -1,4 +1,4 @@ -import { codeToHtml } from "shiki" +import { codeToHtml, bundledLanguages } from "shiki" import { createResource, Suspense } from "solid-js" import { transformerNotationDiff } from "@shikijs/transformers" import style from "./content-code.module.css" @@ -15,7 +15,7 @@ export function ContentCode(props: Props) { // TODO: For testing delays // await new Promise((resolve) => setTimeout(resolve, 3000)) return (await codeToHtml(code || "", { - lang: lang || "text", + lang: lang && lang in bundledLanguages ? lang : "text", themes: { light: "github-light", dark: "github-dark", diff --git a/packages/web/src/components/share/part.module.css b/packages/web/src/components/share/part.module.css index 4216cfc39..8b1a8c25b 100644 --- a/packages/web/src/components/share/part.module.css +++ b/packages/web/src/components/share/part.module.css @@ -150,7 +150,6 @@ flex-direction: column; align-items: flex-start; gap: 0.375rem; - padding-bottom: 1rem; [data-slot="provider"] { line-height: 18px;