-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.html
36 lines (32 loc) · 1.14 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Security-Policy" content="script-src 'nonce-xxxx'">
<title></title>
<script async src="loader.min.js"
data-hljs-observe="body"
data-hljs-options='{"classPrefix":"hljs-"}'
data-hljs-style="github-dark-dimmed"
nonce="xxxx"
></script>
</head>
<body>
<pre><code class="language-html"><script async src="loader.min.js"
data-hljs-observe="body"
data-hljs-options='{"classPrefix":"hljs-"}'
data-hljs-style="github-dark-dimmed"
></script></code></pre>
<pre><code class="language-js">console.log('Hello ' + user);</code></pre>
<p style="cursor:pointer">Click here to add an Erlang code block. Its grammar file will be loaded automatically.</p>
<script nonce="xxxx">
document.querySelector('p').onclick = function ()
{
let pre = document.createElement('pre'),
code = pre.appendChild(document.createElement('code'));
code.className = 'language-erlang';
code.innerHTML = '-module(hello).\n-export([hello_world/0]).\n\nhello_world() -> io:fwrite("hello, world\\n").';
document.body.appendChild(pre);
};
</script>
</body>
</html>