From d91f8b90aa2b3dbcb4533957333687df4e32fee9 Mon Sep 17 00:00:00 2001 From: sendevia Date: Sat, 28 Feb 2026 20:28:41 +0800 Subject: [PATCH] rename: sectionWrapper to mdSectionWrapper --- .vitepress/config.ts | 4 ++-- .../theme/utils/{sectionWrapper.ts => mdSectionWrapper.ts} | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename .vitepress/theme/utils/{sectionWrapper.ts => mdSectionWrapper.ts} (96%) diff --git a/.vitepress/config.ts b/.vitepress/config.ts index 189804e..7312b83 100644 --- a/.vitepress/config.ts +++ b/.vitepress/config.ts @@ -12,7 +12,7 @@ import { footnote } from "@mdit/plugin-footnote"; import { tasklist } from "@mdit/plugin-tasklist"; // https://mdit-plugins.github.io/img-mark.html import { imgMark } from "@mdit/plugin-img-mark"; -import { wrapHeadingsAsSections } from "./theme/utils/sectionWrapper"; +import { sectionWrapper } from "./theme/utils/mdSectionWrapper"; export default defineConfig({ base: "/", @@ -42,7 +42,7 @@ export default defineConfig({ config(md) { md.use(align); md.use(footnote); - md.use(wrapHeadingsAsSections); + md.use(sectionWrapper); md.use(tasklist, { label: true }); md.use(imgMark); }, diff --git a/.vitepress/theme/utils/sectionWrapper.ts b/.vitepress/theme/utils/mdSectionWrapper.ts similarity index 96% rename from .vitepress/theme/utils/sectionWrapper.ts rename to .vitepress/theme/utils/mdSectionWrapper.ts index a3a8d12..34bc671 100644 --- a/.vitepress/theme/utils/sectionWrapper.ts +++ b/.vitepress/theme/utils/mdSectionWrapper.ts @@ -4,7 +4,7 @@ import type MarkdownIt from "markdown-it"; * 将连续的标题块包裹为独立的 section(headline-block),便于样式与交互处理 * @param mdit - MarkdownIt 实例 */ -export function wrapHeadingsAsSections(mdit: MarkdownIt): void { +export function sectionWrapper(mdit: MarkdownIt): void { if (!mdit || !mdit.core || !mdit.core.ruler) { console.warn("Invalid MarkdownIt instance provided"); return;