Browse Source

add support for data-trim attribute on code elements (closes #419)

embed
Hakim El Hattab 12 years ago
parent
commit
a764c21cd1
  1. 4
      README.md
  2. 5
      index.html
  3. 16
      plugin/highlight/highlight.js

4
README.md

@ -332,11 +332,11 @@ 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: 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 ```html
<section> <section>
<pre><code> <pre><code data-trim>
(def lazy-fib (def lazy-fib
(concat (concat
[0 1] [0 1]

5
index.html

@ -208,7 +208,8 @@
<p> <p>
Additionally custom events can be triggered on a per slide basis by binding to the <code>data-state</code> name. Additionally custom events can be triggered on a per slide basis by binding to the <code>data-state</code> name.
</p> </p>
<pre><code contenteditable style="font-size: 18px; margin-top: 20px;">Reveal.addEventListener( 'customevent', function() { <pre><code data-trim contenteditable style="font-size: 18px; margin-top: 20px;">
Reveal.addEventListener( 'customevent', function() {
console.log( '"customevent" has fired' ); console.log( '"customevent" has fired' );
} ); } );
</code></pre> </code></pre>
@ -228,7 +229,7 @@
<section> <section>
<h2>Pretty Code</h2> <h2>Pretty Code</h2>
<pre><code contenteditable> <pre><code data-trim contenteditable>
function linkify( selector ) { function linkify( selector ) {
if( supports3DTransforms ) { if( supports3DTransforms ) {

16
plugin/highlight/highlight.js

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save