-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathindex.html
163 lines (128 loc) · 3.79 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>md-block: Render styleable Markdown in your HTML</title>
<link rel="icon" href="logo.svg">
<link rel="stylesheet" href="prism.css">
<link rel="stylesheet" href="https://live.prismjs.com/prism-live.css">
<link rel="stylesheet" href="style.css">
<!-- <script src="md-block.js" type="module"></script> -->
<script src="demo.js" type="module"></script>
<script src="prism.js"></script>
<script src="https://live.prismjs.com/src/prism-live.js?load=html,markdown"></script>
</head>
<body>
<header>
<h1><md-block></h1>
<md-block>
Render styleable Markdown in your HTML.
Uses [marked](https://marked.js.org/) under the hood.
</md-block>
</header>
<nav>
<a href="#usage">Usage</a>
<a href="#api">API</a>
<a href="#recipes">Recipes</a>
<a href="tests.html">Tests</a>
<a href="https://github.com/leaverou/md-block">GitHub</a>
</nav>
<main>
<md-block src="README.md" hmin="2">
[Documentation on GitHub](https://github.com/leaverou/md-block/#readme)
</md-block>
<section>
<h2 id="demos">Demos</h2>
<p>Block</p>
<script type="text/html" class="md-block-demo">
<md-block>
# Heading
Text **bold text** *italic text* ~strike~
```js
test.foo();
```
```html
<foo>
```
* List item 1
* List item 2
</md-block>
</script>
<p>Block with incorrect src and fallback content</p>
<script type="text/html" class="md-block-demo">
<md-block src="nonexistent.md">
`nonexistent.md` was *not* found
</md-block>
</script>
<p>Minimum heading level:</p>
<script type="text/html" class="md-block-demo">
<md-block hmin="3">
# Heading 3
## Heading 4
### Heading 5
#### Heading 6
##### Still heading 6
</md-block>
</script>
<p>Heading links</p>
<script type="text/html" class="md-block-demo">
<md-block hlinks>
# Heading 1
## Heading 2
### Heading 3
</md-block>
<md-block hlinks="§">
# Heading 1
## Heading 2
### Heading 3
</md-block>
</script>
<p>Inline. Note that block level syntax like headings, code blocks, or lists is not processed</p>
<script type="text/html" class="md-block-demo">
<md-span>
# Heading
Text **bold text** *italic text* ~strike~
```js
test.foo();
```
```html
<foo>
```
* List item 1
* List item 2
</md-span>
</script>
<md-block>With and without [sanitization](#handling-untrusted-content).</md-block>
<script type="text/html" class="md-block-demo">
<md-block untrusted src="data:text/markdown,A [Click me](javascript:alert('hi'))"></md-block>
<md-block src="data:text/markdown,B [Click me](javascript:alert('hi'))"></md-block>
</script>
<p>View source for more demos!</p>
</section>
</main>
<section id="repl">
<h2>Live demo</h2>
<form id="repl_container">
<pre data-title="Input HTML"><code><span class="token punctuation"><</span><select name="tag" class="token tag"><option>md-block</option><option>md-span</option></select> <input name="attributes" placeholder="foo="bar" baz="quux" "><span class="token punctuation">></span>
<textarea name="contents" class="prism-live language-markdown">
*This* is `md-block`
</textarea>
<span class="token punctuation"></</span><output class="token tag" id="end_tag"></output><span class="token punctuation">></span>
</code></pre>
<output id="output_html" data-title="Output HTML">
<pre class="language-markup"><code></code></pre>
</output>
<output id="rendering" data-title="Rendering">
</output>
</form>
</section>
<footer>
<md-span>
Made in haste, by [Lea Verou](https://lea.verou.me). Use at your own risk.
[Pull requests welcome](https://github.com/leaverou/md-block)
</md-span>
</footer>
</body>
</html>