--
cgit v1.2.3
From 4c491e5eccd8533f45c4d3d18a04ac545babe351 Mon Sep 17 00:00:00 2001
From: Hakim El Hattab
Date: Wed, 24 Jul 2013 23:35:18 -0400
Subject: highlight charset option for external md in readme #537
---
README.md | 4 ++--
plugin/markdown/example.html | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
(limited to 'plugin/markdown')
diff --git a/README.md b/README.md
index 96f6b8c..f1a521e 100644
--- a/README.md
+++ b/README.md
@@ -52,10 +52,10 @@ This is based on [data-markdown](https://gist.github.com/1343518) from [Paul Iri
#### External Markdown
-You can write your content as a separate file and have reveal.js load it at runtime. Note the separator arguments which determine how slides are delimited in the external file.
+You can write your content as a separate file and have reveal.js load it at runtime. Note the separator arguments which determine how slides are delimited in the external file. The ```data-charset``` attribute is optional and specifies which charset to use when loading the external file.
```html
-
+
```
### Configuration
diff --git a/plugin/markdown/example.html b/plugin/markdown/example.html
index 90ff134..ceed53f 100644
--- a/plugin/markdown/example.html
+++ b/plugin/markdown/example.html
@@ -16,8 +16,8 @@
-
-
+
+
--
cgit v1.2.3
From efbcab57f74891a060320af1c9e2e3c039febc5a Mon Sep 17 00:00:00 2001
From: Riceball LEE
Date: Wed, 31 Jul 2013 06:48:09 +0800
Subject: * [bug] fixed render markdown file error like this: ```html ```
---
plugin/markdown/markdown.js | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
(limited to 'plugin/markdown')
diff --git a/plugin/markdown/markdown.js b/plugin/markdown/markdown.js
index 473666b..dcab2fa 100755
--- a/plugin/markdown/markdown.js
+++ b/plugin/markdown/markdown.js
@@ -6,6 +6,14 @@
throw 'The reveal.js Markdown plugin requires marked to be loaded';
}
+ if (typeof hljs !== 'undefined') {
+ marked.setOptions({
+ highlight: function (lang, code) {
+ return hljs.highlightAuto(lang, code).value;
+ }
+ });
+ }
+
var stripLeadingWhitespace = function(section) {
var template = section.querySelector( 'script' );
@@ -28,7 +36,7 @@
};
var twrap = function(el) {
- return '';
+ return marked(el);
};
var getForwardedAttributes = function(section) {
@@ -51,7 +59,7 @@
}
return result.join( ' ' );
- }
+ };
var slidifyMarkdown = function(markdown, separator, vertical, attributes) {
@@ -101,12 +109,12 @@
for( var k = 0, klen = sectionStack.length; k < klen; k++ ) {
// horizontal
if( typeof sectionStack[k] === 'string' ) {
- markdownSections += '' + twrap( sectionStack[k] ) + '';
+ markdownSections += '' + twrap( sectionStack[k] ) + '';
}
// vertical
else {
markdownSections += '' +
- '' + sectionStack[k].map(twrap).join('' +
+ '' + sectionStack[k].map(twrap).join('' +
'';
}
}
--
cgit v1.2.3