test-markdown-options.js 694 B

12345678910111213141516171819202122232425262728
  1. Reveal.addEventListener( 'ready', function() {
  2. QUnit.module( 'Markdown' );
  3. QUnit.test( 'Options are set', function( assert ) {
  4. assert.strictEqual( marked.defaults.smartypants, true );
  5. });
  6. QUnit.test( 'Smart quotes are activated', function( assert ) {
  7. var text = document.querySelector( '.reveal .slides>section>p' ).textContent;
  8. assert.strictEqual( /['"]/.test( text ), false );
  9. assert.strictEqual( /[“”‘’]/.test( text ), true );
  10. });
  11. } );
  12. Reveal.initialize({
  13. dependencies: [
  14. { src: '../plugin/markdown/marked.js' },
  15. // Test loading JS files with query strings
  16. { src: '../plugin/markdown/markdown.js?query=string' },
  17. ],
  18. markdown: {
  19. smartypants: true
  20. }
  21. });