mirror of
https://github.com/sendevia/website.git
synced 2026-03-05 23:32:45 +08:00
rename: sectionWrapper to mdSectionWrapper
This commit is contained in:
@@ -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);
|
||||
},
|
||||
|
||||
@@ -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;
|
||||
Reference in New Issue
Block a user