diff --git a/plugin/markdown/markdown.js b/plugin/markdown/markdown.js index f4035e2..5544599 100755 --- a/plugin/markdown/markdown.js +++ b/plugin/markdown/markdown.js @@ -20,8 +20,8 @@ if( typeof hljs !== 'undefined' ) { marked.setOptions({ - highlight: function( lang, code ) { - return hljs.highlightAuto( lang, code ).value; + highlight: function( code, lang ) { + return hljs.highlightAuto( code, [lang] ).value; } }); } diff --git a/test/simple.md b/test/simple.md new file mode 100644 index 0000000..cd57d70 --- /dev/null +++ b/test/simple.md @@ -0,0 +1,10 @@ +## Slide 1.1 + +```js +var a = 1; +``` + +## Slide 1.2 + + +## Slide 2 diff --git a/test/test-markdown-external.html b/test/test-markdown-external.html new file mode 100644 index 0000000..859d0a1 --- /dev/null +++ b/test/test-markdown-external.html @@ -0,0 +1,36 @@ + + + + + + + reveal.js - Test Markdown + + + + + + + +
+
+ + + + + + + + + + + + + + diff --git a/test/test-markdown-external.js b/test/test-markdown-external.js new file mode 100644 index 0000000..a9ea034 --- /dev/null +++ b/test/test-markdown-external.js @@ -0,0 +1,19 @@ + + +Reveal.addEventListener( 'ready', function() { + + QUnit.module( 'Markdown' ); + + test( 'Vertical separator', function() { + strictEqual( document.querySelectorAll( '.reveal .slides>section>section' ).length, 2, 'found two slides' ); + }); + test( 'language highlighter', function() { + strictEqual( document.querySelectorAll( '.hljs-keyword' ).length, 1, 'got rendered highlight tag.' ); + strictEqual( document.querySelector( '.hljs-keyword' ).innerHTML, 'var', 'the same keyword: var.' ); + }); + + +} ); + +Reveal.initialize(); +