sectionize()

将同一标题下的内容组包裹在 `<section>` 元素中。

import { sectionize } from "@unifast/node";

签名

function sectionize(): UnifastPlugin

参数

无。

用法

import { compile, sectionize } from "@unifast/node";

const md = `# Introduction

Some introductory text.

## Getting Started

Instructions for getting started.

## Configuration

Configuration details here.`;

const result = compile(md, {
  plugins: [sectionize()],
});
// Each heading and its following content are wrapped in a <section> element

示例

标题分节