forked from highlightjs/highlight.js
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
136 lines (99 loc) · 3.88 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>highlight.js test</title>
</head>
<body>
<div id="explicit-language">
<!-- explicit language (code) -->
<pre><code class="python">for x in [1, 2, 3]:
count(x)</code></pre>
<!-- explicit language (pre) -->
<pre class="python"><code>for x in [1, 2, 3]:
count(x)</code></pre>
<!-- html 5 style language class -->
<pre><code class="language-python">for x in [1, 2, 3]:
count(x)</code></pre>
<!-- shortened language prefix -->
<pre><code class="lang-scss">@import "compass/reset";
$colorGreenDark: darken($colorGreen, 10);
</code></pre>
<!-- uppercase symbols -->
<pre><code class="SCSS">@import "compass/reset";
$colorGreenDark: darken($colorGreen, 10);
</code></pre>
</div>
<div id="custom-markup">
<!-- tab replacement -->
<pre><code class="python">for x in [1, 2, 3]:
count(x)</code></pre>
<!-- custom markup -->
<pre><code class="html"><<a href="http://dev.w3.org/html5/spec/Overview.html#the-div-element">div</a> id="contents">
<del><p>Hello, World!</del><!-- A comment should not break merging --><ins>Goodbye, cruel world!</ins>
</div>
</code></pre>
<!-- custom markup and tab replacement -->
<pre><code class="python">for x in [1, 2, 3]:
<span style="background:yellow"> </span>count(x)
if x == 3:
<span style="background:yellow"> </span>count(x + 1)</code></pre>
<!-- <br> inside of <pre>s -->
<pre><code class="language-javascript">>> '\x41\x42\x43'<br>'ABC'<br><hr><br>>> '\x61\x62\x63'<br>'abc'
</code></pre>
</div>
<div id="language-alias">
<!-- language alias -->
<pre><code class="language-js">var x = '<p>this should <b>not</b> be highlighted as <em>HTML</em>';</code></pre>
</div>
<div id="no-highlight">
<!-- disable highlighting -->
<pre><code class="nohighlight"><div id="contents">
<p>Hello, World!
</div></code></pre>
<pre><code class="no-highlight"><div id="contents">
<p>Hello, World!
</div></code></pre>
<!-- non-code <pre> -->
<pre><samp>Computer output</samp></pre>
<!-- unsupported language-prefixed class -->
<pre><code class="language-foo">for x in [1, 2, 3]: count(x)</code></pre>
<!-- unsupported shortened language-prefixed class -->
<pre><code class="lang-foo">for x in [1, 2, 3]: count(x)</code></pre>
<!-- unsupported prefixed language and supported unprefixed language -->
<pre><code class="python language-foo">for x in [1, 2, 3]: count(x)</code></pre>
</div>
<!-- sub-languages -->
<pre><code id="sublanguages" class="php-html"><? echo 'php'; /* ?> */ ?>
<body>
<script>document.write('Legacy code');</script>
</body>
</code></pre>
<div id="build-classname">
<!-- add class name -->
<pre><code class=" some-class "><?xml version="1.0"?>
<response value="ok" xml:lang="en"></response></code></pre>
<!-- do not clutter class name first -->
<pre><code class="hljs some-class "><?xml version="1.0"?>
<response value="ok" xml:lang="en"></response></code></pre>
<!-- do not clutter class name last -->
<pre><code class=" some-class hljs"><?xml version="1.0"?>
<response value="ok" xml:lang="en"></response></code></pre>
<!-- do not clutter class name spaces around-->
<pre><code class=" hljs some-class "><?xml version="1.0"?>
<response value="ok" xml:lang="en"></response></code></pre>
</div>
<div id="use-br">
<div class="code xml"><head><br> <meta charset="utf-8"><br> <title></title><br></head></div>
<div class="code xml"><head><br>
<meta charset="utf-8"><br>
<title></title><br>
</head></div>
<div class="code xml"><head><br>
<meta charset="utf-8"><br/>
<title></title><br />
</head></div>
</div>
<pre id="ends-with-parent-variants"><code class="language-nested">( [ ( ) ] )</code></pre>
</body>
</html>