1
0
mirror of https://github.com/hakimel/reveal.js.git synced 2025-08-30 17:59:59 +02:00

Enable passing options for parsing Markdown.

Closes #1163, #1495.
This commit is contained in:
Benjamin Tan
2016-12-08 17:41:55 +08:00
parent 2bd6b563be
commit 90b301d0a0
5 changed files with 99 additions and 14 deletions

View File

@@ -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
}
});