Replace the ShowDown Markdown engine with marked
This commit is contained in:
parent
247771e129
commit
381da383d9
8 changed files with 1138 additions and 73 deletions
|
@ -86,7 +86,7 @@
|
|||
// Optional libraries used to extend on reveal.js
|
||||
dependencies: [
|
||||
{ src: '../../lib/js/classList.js', condition: function() { return !document.body.classList; } },
|
||||
{ src: 'showdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
|
||||
{ src: 'marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
|
||||
{ src: 'markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }
|
||||
]
|
||||
});
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
// Modified by Hakim to handle Markdown indented with tabs
|
||||
(function(){
|
||||
|
||||
if( typeof Showdown === 'undefined' ) {
|
||||
throw 'The reveal.js Markdown plugin requires Showdown to be loaded';
|
||||
if( typeof marked === 'undefined' ) {
|
||||
throw 'The reveal.js Markdown plugin requires marked to be loaded';
|
||||
}
|
||||
|
||||
var stripLeadingWhitespace = function(section) {
|
||||
|
@ -175,7 +175,7 @@
|
|||
|
||||
var markdown = stripLeadingWhitespace(section);
|
||||
|
||||
section.innerHTML = (new Showdown.converter()).makeHtml(markdown);
|
||||
section.innerHTML = marked(markdown);
|
||||
|
||||
if( notes ) {
|
||||
section.appendChild( notes );
|
||||
|
|
1127
plugin/markdown/marked.js
Normal file
1127
plugin/markdown/marked.js
Normal file
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
|
@ -99,7 +99,7 @@
|
|||
<div id="notes"></div>
|
||||
|
||||
<script src="/socket.io/socket.io.js"></script>
|
||||
<script src="/plugin/markdown/showdown.js"></script>
|
||||
<script src="/plugin/markdown/marked.js"></script>
|
||||
|
||||
<script>
|
||||
var socketId = '{{socketId}}';
|
||||
|
@ -113,7 +113,7 @@
|
|||
if (data.socketId !== socketId) { return; }
|
||||
|
||||
if (data.markdown) {
|
||||
notes.innerHTML = (new Showdown.converter()).makeHtml(data.notes);
|
||||
notes.innerHTML = marked(data.notes);
|
||||
}
|
||||
else {
|
||||
notes.innerHTML = data.notes;
|
||||
|
|
|
@ -159,7 +159,7 @@
|
|||
|
||||
<div id="notes"></div>
|
||||
|
||||
<script src="../../plugin/markdown/showdown.js"></script>
|
||||
<script src="../../plugin/markdown/marked.js"></script>
|
||||
<script>
|
||||
|
||||
window.addEventListener( 'load', function() {
|
||||
|
@ -175,7 +175,7 @@
|
|||
// No need for updating the notes in case of fragment changes
|
||||
if ( data.notes !== undefined) {
|
||||
if( data.markdown ) {
|
||||
notes.innerHTML = (new Showdown.converter()).makeHtml( data.notes );
|
||||
notes.innerHTML = marked( data.notes );
|
||||
}
|
||||
else {
|
||||
notes.innerHTML = data.notes;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue