This commit is contained in:
root
2026-06-07 23:18:53 +08:00
parent ebd3d6a317
commit 934b9a4a23
36 changed files with 2272 additions and 296 deletions

View File

@@ -6,6 +6,7 @@ import remarkGfm from "remark-gfm";
import rehypeHighlight from "rehype-highlight";
import "highlight.js/styles/atom-one-dark.min.css";
import styles from "./lesson-markdown.module.css";
import { mediaUrl } from "@/app/lib/media";
type TocItem = { level: number; text: string; id: string };
@@ -120,7 +121,7 @@ export function LessonMarkdown({ content }: { content: string }) {
),
img: ({ src, alt }) => (
// eslint-disable-next-line @next/next/no-img-element
<img src={src || ""} alt={alt || ""} loading="lazy" decoding="async" />
<img src={mediaUrl(typeof src === "string" ? src : "")} alt={alt || ""} loading="lazy" decoding="async" />
),
table: ({ children }) => (
<div className="overflow-x-auto">