content/(plugins)/(marks)/basic-marks.cn.mdx
BasicMarksKit 集成了加粗、斜体、下划线、删除线、代码、下标、上标、高亮和键盘键标记的插件,以及来自 Plate UI 的相应 UI 组件。同时也注册了这些 mark family 自带的 Markdown input rules。
CodeLeaf: 渲染内联代码元素。HighlightLeaf: 渲染高亮文本元素。KbdLeaf: 渲染键盘快捷键元素。将套件添加到你的插件中:
import { createPlateEditor } from 'platejs/react';
import { BasicMarksKit } from '@/components/editor/plugins/basic-marks-kit';
const editor = createPlateEditor({
plugins: [
// ...其他插件
...BasicMarksKit,
],
});
该套件默认启用常见的 mark 快捷输入,例如:
**bold** / __bold__*italic* / _italic_`code`~~strike~~~sub~^sup^==highlight==完整运行时模型请参阅 Plugin Input Rules。
npm install @platejs/basic-nodes
你可以将 MarkToolbarButton 添加到 工具栏 来控制文本格式标记。
如需单个插件的设置和配置,请参阅上方链接的特定插件文档页面。