diff options
author | Benjamin Tan <demoneaux@gmail.com> | 2016-12-08 17:41:55 +0800 |
---|---|---|
committer | Benjamin Tan <demoneaux@gmail.com> | 2016-12-08 17:41:55 +0800 |
commit | 90b301d0a03b8b23ce755c31ec6dac15cf69dc49 (patch) | |
tree | 6079937a9f78770c1bf291da38716782f0ac6e5a /test | |
parent | 2bd6b563be65bb0ff95593b30572ca72fd3e8b77 (diff) | |
download | fosdem-2018-presentation-90b301d0a03b8b23ce755c31ec6dac15cf69dc49.tar fosdem-2018-presentation-90b301d0a03b8b23ce755c31ec6dac15cf69dc49.tar.gz |
Enable passing options for parsing Markdown.
Closes #1163, #1495.
Diffstat (limited to 'test')
-rw-r--r-- | test/test-markdown-options.html | 41 | ||||
-rw-r--r-- | test/test-markdown-options.js | 26 | ||||
-rw-r--r-- | test/test-markdown.html | 2 |
3 files changed, 68 insertions, 1 deletions
diff --git a/test/test-markdown-options.html b/test/test-markdown-options.html new file mode 100644 index 0000000..5b3be97 --- /dev/null +++ b/test/test-markdown-options.html @@ -0,0 +1,41 @@ +<!doctype html> +<html lang="en"> + + <head> + <meta charset="utf-8"> + + <title>reveal.js - Test Markdown Options</title> + + <link rel="stylesheet" href="../css/reveal.css"> + <link rel="stylesheet" href="qunit-1.12.0.css"> + </head> + + <body style="overflow: auto;"> + + <div id="qunit"></div> + <div id="qunit-fixture"></div> + + <div class="reveal" style="display: none;"> + + <div class="slides"> + + <section data-markdown> + <script type="text/template"> + ## Testing Markdown Options + + This "slide" should contain 'smart' quotes. + </script> + </section> + + </div> + + </div> + + <script src="../lib/js/head.min.js"></script> + <script src="../js/reveal.js"></script> + <script src="qunit-1.12.0.js"></script> + + <script src="test-markdown-options.js"></script> + + </body> +</html> diff --git a/test/test-markdown-options.js b/test/test-markdown-options.js new file mode 100644 index 0000000..3ae1350 --- /dev/null +++ b/test/test-markdown-options.js @@ -0,0 +1,26 @@ +Reveal.addEventListener( 'ready', function() { + + QUnit.module( 'Markdown' ); + + test( 'Options are set', function() { + strictEqual( marked.defaults.smartypants, true ); + }); + + test( 'Smart quotes are activated', function() { + var text = document.querySelector( '.reveal .slides>section>p' ).textContent; + + strictEqual( /['"]/.test( text ), false ); + strictEqual( /[“”‘’]/.test( text ), true ); + }); + +} ); + +Reveal.initialize({ + dependencies: [ + { src: '../plugin/markdown/marked.js' }, + { src: '../plugin/markdown/markdown.js' }, + ], + markdown: { + smartypants: true + } +}); diff --git a/test/test-markdown.html b/test/test-markdown.html index 7ff0efe..52b39ff 100644 --- a/test/test-markdown.html +++ b/test/test-markdown.html @@ -13,7 +13,7 @@ <body style="overflow: auto;"> <div id="qunit"></div> - <div id="qunit-fixture"></div> + <div id="qunit-fixture"></div> <div class="reveal" style="display: none;"> |