Add the data-noescape attribute and example
This commit is contained in:
parent
0c971b06e4
commit
d6d4c68013
|
@ -582,15 +582,15 @@ Reveal.addEventListener( 'fragmenthidden', function( event ) {
|
||||||
|
|
||||||
### Code syntax highlighting
|
### Code syntax highlighting
|
||||||
|
|
||||||
By default, Reveal is configured with [highlight.js](http://softwaremaniacs.org/soft/highlight/en/) for code syntax highlighting. Below is an example with clojure code that will be syntax highlighted. When the `data-trim` attribute is present surrounding whitespace is automatically removed.
|
By default, Reveal is configured with [highlight.js](http://softwaremaniacs.org/soft/highlight/en/) for code syntax highlighting. Below is an example with clojure code that will be syntax highlighted. When the `data-trim` attribute is present, surrounding whitespace is automatically removed. HTML will be escaped by default. To avoid this, for example if you are using `<mark>` to call out a line of code, add the `data-noescape` attribute to the `<code>` element.
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<section>
|
<section>
|
||||||
<pre><code data-trim>
|
<pre><code data-trim data-noescape>
|
||||||
(def lazy-fib
|
(def lazy-fib
|
||||||
(concat
|
(concat
|
||||||
[0 1]
|
[0 1]
|
||||||
((fn rfib [a b]
|
<mark>((fn rfib [a b]</mark>
|
||||||
(lazy-cons (+ a b) (rfib b (+ a b)))) 0 1)))
|
(lazy-cons (+ a b) (rfib b (+ a b)))) 0 1)))
|
||||||
</code></pre>
|
</code></pre>
|
||||||
</section>
|
</section>
|
||||||
|
|
Loading…
Reference in New Issue