index.html 编辑器,index.html

MarkDown富文本编辑器

.showCode{

width: 100%;

height:100%;

border: 1px solid #ccc;

}

img{

width: 750px;

}

$(function(){

//富文本编辑器配置

simplemde = new SimpleMDE({

autofocus: false,//是否自动对焦

//自定义样式文本块的某些按钮的行为方式

blockStyles: {

bold: "__",

italic: "_"

},

element: document.getElementById("code"),//选择器

indentWithTabs: true,//如果设置为false,则使用空格而不是制表符缩进。默认为true。

insertTexts: {

horizontalRule: ["", "\n\n-----\n\n"],

image: ["![](http://", ")"],

link: ["[", "](http://)"],

table: ["", "\n\n| Column 1 | Column 2 | Column 3 |\n| -------- | -------- | -------- |\n| Text | Text | Text |\n\n"],

},

lineWrapping: false,//如果设置为false,则禁用换行。默认为true。

parsingConfig: {

allowAtxHeaderWithoutSpace: true,

strikethrough: true,

underscoresBreakWords: true,

},

placeholder: "请使用 Markdown 格式书写 ;-),代码块请标语言,示例如下,否则无高亮\n```php\n//代码开始\n```\nOK!开始你的创作吧!",

promptURLs: false,

//快捷键

shortcuts: {

drawTable: "Cmd-Alt-T"

},

showIcons: ["code", "table"],

spellChecker: false,//检查拼音

status: true,

status: ["autosave", "lines", "words", "cursor"], // Optional usage

status: ["autosave", "lines", "words", "cursor", {

className: "keystrokes",

defaultValue: function(el) {

this.keystrokes = 0;

el.innerHTML = "0 Keystrokes";

},

onUpdate: function(el) {

el.innerHTML = ++this.keystrokes + " Keystrokes";

}

}], // Another optional usage, with a custom status bar item that counts keystrokes

styleSelectedText: false,

tabSize: 8,

toolbarTips:true,

});

// $("textarea").keyup(function(){

// var content = simplemde.value();

// var converter = new showdown.Converter();

// markdown_content = converter.makeHtml(content);

// $('.showCode').html(markdown_content);

// });

})

一键复制

编辑

Web IDE

原始数据

按行查看

历史

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值