当前位置:网站首页>Markdown编辑器Editor.md插件的使用
Markdown编辑器Editor.md插件的使用
2022-07-07 06:11:00 【HHYZBC】
官网:
Editor.md - 开源在线 Markdown 编辑器 (pandao.github.io)
https://pandao.github.io/editor.md/index.html配置项:
var testEditor;
testEditor = editormd("test-editormd", {
placeholder:'本编辑器支持Markdown编辑,左边编写,右边预览', //默认显示的文字,这里就不解释了
width: "90%",
height: 640,
syncScrolling: "single",
path: "lib/js/editor.md-master/lib/", //你的path路径(原资源文件中lib包在我们项目中所放的位置)
theme: "dark",//工具栏主题
previewTheme: "dark",//预览主题
editorTheme: "pastel-on-dark",//编辑主题
saveHTMLToTextarea: true,
emoji: false,
taskList: true,
tocm: true, // Using [TOCM]
tex: true, // 开启科学公式TeX语言支持,默认关闭
flowChart: true, // 开启流程图支持,默认关闭
sequenceDiagram: true, // 开启时序/序列图支持,默认关闭,
toolbarIcons : function() { //自定义工具栏,后面有详细介绍
return editormd.toolbarModes['simple']; // full, simple, mini
},
});
//上面的挑有用的写上去就行获取Markdown格式的文本
document.querySelector('.editormd-markdown-textarea').value 获取markdown渲染过的文章
document.querySelector('.markdown-body').textContent,自定义工具栏
工具栏分为三组,full, simple, mini这三个,可以选择,也可以自由的设置工具栏,自由的设置工具栏在官网中有写,在这里就只介绍3组。
t.toolbarModes={
full:["undo","redo","|","bold","del","italic","quote","ucwords","uppercase","lowercase","|","h1","h2","h3","h4","h5","h6","|","list-ul","list-ol","hr","|","link","reference-link","image","code","preformatted-text","code-block","table","datetime","emoji","html-entities","pagebreak","|","goto-line","watch","preview","fullscreen","clear","search","|","help","info"],
simple:["undo","redo","|","bold","del","italic","quote","uppercase","lowercase","|","h1","h2","h3","h4","h5","h6","|","list-ul","list-ol","hr","|","watch","preview","fullscreen","|","help","info"],
mini:["undo","redo","|","watch","preview","|","help","info"]
}每一个标签表示一个工具,也可以随意使用上面的标签自定义工具栏,每个标签具体表示的工具官网上没有,所以只能与工具栏对照一下才行了
边栏推荐
- let const
- 关于基于kangle和EP面板使用CDN
- Componentspace2022, assertions, protocols, bindings, and configuration files
- Go write a program that runs within a certain period of time
- 快速集成认证服务-HarmonyOS平台
- Teach you how to select PCB board by hand (II)
- MySQL introduction - crud Foundation (establishment of the prototype of the idea of adding, deleting, changing and searching)
- NCS Chengdu New Electric interview Experience
- Opencv converts 16 bit image data to 8 bits and 8 to 16
- IP地址的类别
猜你喜欢
![[南京大学]-[软件分析]课程学习笔记(一)-introduction](/img/57/bf652b36389d2bf95388d2eb4772a1.png)
[南京大学]-[软件分析]课程学习笔记(一)-introduction
![Upload an e-office V9 arbitrary file [vulnerability recurrence practice]](/img/e7/278193cbc2a2f562270f99634225bc.jpg)
Upload an e-office V9 arbitrary file [vulnerability recurrence practice]

关于基于kangle和EP面板使用CDN

Greenplum 6.x build_ install

idea里使用module项目的一个bug

详解华为应用市场2022年逐步减少32位包体上架应用和策略

Go语言中,函数是一种类型

MySQL introduction - crud Foundation (establishment of the prototype of the idea of adding, deleting, changing and searching)
![[step on the pit] Nacos registration has been connected to localhost:8848, no available server](/img/ee/ab4d62745929acec2f5ba57155b3fa.png)
[step on the pit] Nacos registration has been connected to localhost:8848, no available server

NCS Chengdu Xindian interview experience
随机推荐
Introduction to data fragmentation
uniapp 微信小程序监测网络
調用華為遊戲多媒體服務的創建引擎接口返回錯誤碼1002,錯誤信息:the params is error
Gson转换实体类为json时报declares multiple JSON fields named
JEditableTable的使用技巧
IP地址的类别
SSM integration
Greenplum6.x搭建_安装
POJ - 3784 running medium
对API接口或H5接口做签名认证
FPGA knowledge accumulation [6]
Greenplum6.x-版本变化记录-常用手册
基本数据类型和string类型互相转化
Leetcode 1984. Minimum difference in student scores
Golan idea IntelliJ cannot input Chinese characters
Tronapi-波场接口-源码无加密-可二开--附接口文档-基于ThinkPHP5封装-作者详细指导-2022年7月6日-新手快速上手-可无缝升级tp6版本
Appeler l'interface du moteur de création du service multimédia de jeu Huawei renvoie le Code d'erreur 1002, le message d'erreur: les paramètres sont l'erreur
Gson converts the entity class to JSON times declare multiple JSON fields named
POJ - 3616 Milking Time(DP+LIS)
JS的操作