Skip to content

Commit

Permalink
更新修复例子
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Aug 17, 2015
1 parent 0abcd90 commit 809c38c
Showing 1 changed file with 8 additions and 36 deletions.
44 changes: 8 additions & 36 deletions test/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,47 +8,17 @@
</head>
<body>
<div id="mdeditor" class="mdeditor">
# 简易Markdownd编辑器

<pre># 简易Markdownd编辑器
[![](https://img.shields.io/github/issues/jaywcjlove/MDEditor.svg)](https://github.com/jaywcjlove/MDEditor/issues) [![](https://img.shields.io/github/forks/jaywcjlove/MDEditor.svg)](https://github.com/jaywcjlove/MDEditor/network) [![](https://img.shields.io/github/stars/jaywcjlove/MDEditor.svg)](https://github.com/jaywcjlove/MDEditor/stargazers) [![](https://img.shields.io/github/release/jaywcjlove/MDEditor.svg)](https://github.com/jaywcjlove/MDEditor/releases)

## 使用

[预览MDEditor](http://jaywcjlove.github.io/MDEditor)

```js
mde.getMD() //=>返回markdown字符串
```

##使用

html
- 添加 `MDEditor.min.css` 样式
- 添加 `MDEditor.min.js` 并不是 ~~`lib/MDEditor.js`~~ 哦
- 添加编辑器初始节点

```html
<link rel="stylesheet" type="text/css" href="../themes/default/css/MDEditor.min.css">
<script type="text/javascript" src="../build/MDEditor.min.js"></script>
<div id="mdeditor">
# 这里放markdown初始值
- id: 节点id
- minheight: 初始化编辑器高度
- maxheight: 编辑器随着输入内容增多而变高,这个值是它的最大值
- value: 默认编辑器中显示markdown内容
</div>
```

js

```js
var mde = new MDEditor({
id:"#mdeditor",
minheight:300,
maxheight:600,
value:"#多多少少的"
}).load().input(function(evn,opts){
console.log("evn:",evn)
console.log("opts:",opts)
})
```

## MDEditor初始化

Expand Down Expand Up @@ -101,19 +71,21 @@
```js
mde.setHTML(val)
```
</pre>

</div>
<script type="text/javascript">
var mde = new MDEditor({
id:"#mdeditor",
minheight:300,
maxheight:600,
value:"#多多少少的"
}).load().input(function(evn,opts){
})
.load().preview().input(function(evn,opts){
console.log("evn:",evn)
console.log("opts:",opts)
})


</script>
</body>
</html>

0 comments on commit 809c38c

Please sign in to comment.