-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
37 lines (32 loc) · 1001 Bytes
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" href="./dist/editor-markdown.css">
</head>
<body>
<div id="editor-markdown"></div>
<div class="btns">
<button type="button" class="btn-c">完成</button>
<button type="button" class="btn-e">编辑</button>
<button type="button" class="btn-p">预览</button>
</div>
<script src="./dist/editor-markdown.js"></script>
<script>
var ed = new EditorMarkdown('editor-markdown', '# markdonw')
document.querySelector('.btn-e').onclick = function () {
ed.edit()
}
document.querySelector('.btn-p').onclick = function () {
ed.preview()
}
document.querySelector('.btn-c').onclick = function () {
alert(ed.getMarkdown())
}
alert(EditorMarkdown.md2html('# asfasf'))
</script>
</body>
</html>