缩放标记
下标扩展 Tiptap 编辑器。 。 。 .
3⁄4 ̄ ̧漯B
从v. 7.0起,createMarkdownEditor已经放弃了一个更友好的MarkdownTittap 扩展名 。 见 移徙指南。 。 。 .
安装
npm install tiptap-markdown
所需资源
支持由 Tiptap 处理的所有框架( 第 2 个 Vue 3 个 Vue 3, React, 参见完整列表. ) (中文(简体) )
使用量
基本实例:
import { Editor } from '@tiptap/core';
import StarterKit from '@tiptap/starter-kit';
import { Markdown } from 'tiptap-markdown';
const editor = new Editor({
content: "# Title",
extensions: [
StarterKit,
Markdown,
],
});
const markdownOutput = editor.storage.markdown.getMarkdown();
API 密码
选项
默认选项 :
Markdown.configure({
html: true, // Allow HTML input/output
tightLists: true, // No <p> inside <li> in markdown output
tightListClass: 'tight', // Add class to <ul> allowing you to remove <p> margins when tight
bulletListMarker: '-', // <li> prefix in markdown output
linkify: false, // Create links from "https://..." text
breaks: false, // New lines (\n) in markdown input are converted to <br>
transformPastedText: false, // Allow to paste markdown text in the editor
transformCopiedText: false, // Copied text is transformed to markdown
})
方法
editor.commands.setContent('**test**') // setContent supports markdown format
editor.storage.markdown.getMarkdown(); // get current content as markdown
自定义扩展名
见 实例。 。 。 .
检查亲子标记 默认序列器 用于序列化配置的示例。 检查出标记下 插件 为解析.
捐款
欢迎拉动请求。 对于重大变动,请先开出一个问题来讨论你想要改变什么.
请确保酌情更新测试.
许可证
麻省理工学院许可证(MIT). 请看 许可证文件 更多信息.