fa23-si/test/test-markdown-options.html

68 lines
1.4 KiB
HTML
Raw Normal View History

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>reveal.js - Test Markdown Options</title>
2020-03-06 19:12:20 +00:00
<link rel="stylesheet" href="../dist/reveal.css">
<link rel="stylesheet" href="qunit-2.5.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="qunit-2.5.0.js"></script>
<script src="../dist/reveal.min.js"></script>
<script>
Reveal.initialize({
dependencies: [
{ src: '../plugin/markdown/marked.js' },
// Test loading JS files with query strings
{ src: '../plugin/markdown/markdown.js?query=string' },
],
markdown: {
smartypants: true
}
}).then( function() {
QUnit.module( 'Markdown' );
QUnit.test( 'Options are set', function( assert ) {
assert.strictEqual( marked.defaults.smartypants, true );
});
QUnit.test( 'Smart quotes are activated', function( assert ) {
var text = document.querySelector( '.reveal .slides>section>p' ).textContent;
assert.strictEqual( /['"]/.test( text ), false );
assert.strictEqual( /[“”‘’]/.test( text ), true );
});
} );
</script>
</body>
</html>