forked from jaredreich/pell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.html
59 lines (49 loc) · 1.27 KB
/
demo.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="user-scalable=1.0,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0">
<title>pell</title>
<link rel="stylesheet" type="text/css" href="dist/pell.css">
<style>
body {
margin: 0;
padding: 0;
}
.content {
box-sizing: border-box;
margin: 0 auto;
max-width: 600px;
padding: 20px;
}
#html-output {
white-space: pre-wrap;
}
</style>
</head>
<body>
<div class="content">
<h1>pell</h1>
<div id="pell" class="pell"></div>
<div style="margin-top:20px;">
<h3>Text output:</h3>
<div id="text-output"></div>
</div>
<div style="margin-top:20px;">
<h3>HTML output:</h3>
<pre id="html-output"></pre>
</div>
</div>
<script src="dist/pell.js"></script>
<script>
var editor = window.pell.init({
element: document.getElementById('pell'),
defaultParagraphSeparator: 'p',
styleWithCSS: false,
onChange: function (html) {
document.getElementById('text-output').innerHTML = html
document.getElementById('html-output').textContent = html
}
})
</script>
</body>
</html>