@@ -40,6 +40,12 @@ HTML and CSS that you can use with that plugin.
|
||||
For your convenience, below is some sample HTML and CSS code covering all the
|
||||
plugins that you may want to use or adapt.
|
||||
|
||||
Additional parameters for addons
|
||||
--------------------------------
|
||||
|
||||
Some addons can handle additional HTML data attributes to help us in further customization:
|
||||
- Markdown-JS: You can pass a specific Markdown dialect to the plugin using `data-markdown-dialect="Another Dialect"`.
|
||||
|
||||
### Sample HTML to enable plugins and extra addons
|
||||
|
||||
<head>
|
||||
|
||||
@@ -25,10 +25,11 @@
|
||||
var markdownDivs = document.querySelectorAll( ".markdown" );
|
||||
for ( var idx = 0; idx < markdownDivs.length; idx++ ) {
|
||||
var element = markdownDivs[ idx ];
|
||||
var dialect = element.dataset.markdownDialect;
|
||||
|
||||
var slides = element.textContent.split( /^-----$/m );
|
||||
var i = slides.length - 1;
|
||||
element.innerHTML = markdown.toHTML( slides[ i ] );
|
||||
element.innerHTML = markdown.toHTML( slides[ i ], dialect );
|
||||
|
||||
// If there's an id, unset it for last, and all other, elements,
|
||||
// and then set it for the first.
|
||||
|
||||
Reference in New Issue
Block a user