-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheditor.html
44 lines (39 loc) · 1.19 KB
/
editor.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
38
39
40
41
42
43
44
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Markdown在线编辑体验</title>
<link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<link href="./css/editor.css" rel="stylesheet">
</head>
<body>
<div class="keep_center">
<h1 class="text-center title">Markdown在线编辑体验</h1>
<a class="go_md" href="https://roc-mountain.github.io/Markdown/" target="_blank">Markdown编写文档</a>
<div class="nav">
<div class="left">编辑区</div>
<div class="right">预览区</div>
</div>
<div class="content">
<textarea id="text_area" oninput="this.control.change()" rows="18" cols="60">
# 开始测试*Markdown*吧
-------
> 可以删除当前内容,做自己的测试
</textarea>
<div id="html_area"></div>
</div>
</div>
<script src="./javascript/markdown.min.js"></script>
<script>
function Editor(text, html) {
this.change = function () {
html.innerHTML = markdown.toHTML(text.value);
};
text.control = this;
this.change();
}
var $ = function (id) { return document.getElementById(id); };
new Editor($("text_area"), $("html_area"));
</script>
</body>
</html>