editor.md使用php,editor.md 配置参数和使用方法
发布日期:2021-06-24 10:48:30 浏览次数:4 分类:技术文章

本文共 1837 字,大约阅读时间需要 6 分钟。

var testEditor;

$(function() {

$.get('test.md', function(md){

testEditor = editormd("test-editormd", {

width: "90%",

height: 740,

path : '../lib/',

theme : "dark",

previewTheme : "dark",

editorTheme : "pastel-on-dark",

markdown : md,

codeFold : true,

//syncScrolling : false,

saveHTMLToTextarea : true, // 保存 HTML 到 Textarea

searchReplace : true,

//watch : false, // 关闭实时预览

htmlDecode : "style,script,iframe|on*", // 开启 HTML 标签解析,为了安全性,默认不开启

//toolbar : false, //关闭工具栏

//previewCodeHighlight : false, // 关闭预览 HTML 的代码块高亮,默认开启

emoji : true,

taskList : true,

tocm : true, // Using [TOCM]

tex : true, // 开启科学公式TeX语言支持,默认关闭

flowChart : true, // 开启流程图支持,默认关闭

sequenceDiagram : true, // 开启时序/序列图支持,默认关闭,

//dialogLockScreen : false, // 设置弹出层对话框不锁屏,全局通用,默认为true

//dialogShowMask : false, // 设置弹出层对话框显示透明遮罩层,全局通用,默认为true

//dialogDraggable : false, // 设置弹出层对话框不可拖动,全局通用,默认为true

//dialogMaskOpacity : 0.4, // 设置透明遮罩层的透明度,全局通用,默认值为0.1

//dialogMaskBgColor : "#000", // 设置透明遮罩层的背景颜色,全局通用,默认为#fff

imageUpload : true,

imageFormats : ["jpg", "jpeg", "gif", "png", "bmp", "webp"],

imageUploadURL : "./php/upload.php",

onload : function() {

console.log('onload', this);

//this.fullscreen();

//this.unwatch();

//this.watch().fullscreen();

//this.setMarkdown("#PHP");

//this.width("100%");

//this.height(480);

//this.resize("100%", 640);

}

});

});

testEditor.gotoLine(90);//转到第90行

testEditor.show();//显示编辑器

testEditor.hide();//隐藏编辑器

alert(testEditor.getMarkdown());//获取编辑器内容(不含html)

alert(testEditor.getHTML());//获取编辑器html内容

testEditor.watch();//开启双窗口对比

testEditor.unwatch();//取消双窗口对比

testEditor.previewing();//预览效果

testEditor.fullscreen();//全屏(按ESC取消)

testEditor.showToolbar();//显示工具栏

testEditor.hideToolbar();//隐藏工具栏

testEditor.config({

tocDropdown : true,

tocTitle : "目录 Table of Contents",

});//TOC下拉菜单

testEditor.config("tocDropdown", false);//TOC默认                           });

转载地址:https://blog.csdn.net/weixin_32290249/article/details/115991152 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:java中拦截器什么用,[Java教程]SpringMVC中拦截器的使用
下一篇:matlab数据大小不兼容,MATLAB无法执行赋值,因为左侧的索引与右侧的大小不兼容。 求解...

发表评论

最新留言

逛到本站,mark一下
[***.202.152.39]2024年04月10日 05时18分37秒