diff --git a/plugin/markdown/example.html b/plugin/markdown/example.html index 1253cbac7258e32de0fbeb15ff3ac0d2980e7439..90ff1346a578cee526d3fb58539f004b870d8feb 100644 --- a/plugin/markdown/example.html +++ b/plugin/markdown/example.html @@ -16,8 +16,8 @@ <div class="slides"> - <!-- Use external markdown resource, and separate slides by three newlines; vertical slides by two newlines --> - <section data-markdown="example.md" data-separator="^\n\n\n" data-vertical="^\n\n"></section> + <!-- Use external markdown resource, separate slides by three newlines; vertical slides by two newlines and specify a custom charset --> + <section data-markdown="example.md" data-separator="^\n\n\n" data-vertical="^\n\n" data-charset="iso-8859-15"></section> <!-- Slides are separated by three dashes (quick 'n dirty regular expression) --> <section data-markdown data-separator="---"> diff --git a/plugin/markdown/markdown.js b/plugin/markdown/markdown.js index 473666b87d2bb1b94b87119851a115ba2c659c1c..9681cf1dbd37ae47c86fca985ef0a0f58a137895 100755 --- a/plugin/markdown/markdown.js +++ b/plugin/markdown/markdown.js @@ -128,6 +128,12 @@ var xhr = new XMLHttpRequest(), url = section.getAttribute('data-markdown'); + datacharset = section.getAttribute('data-charset'); + // see https://developer.mozilla.org/en-US/docs/Web/API/element.getAttribute#Notes + if (datacharset != null && datacharset != '') { + xhr.overrideMimeType('text/html; charset=' + datacharset); + } + xhr.onreadystatechange = function () { if( xhr.readyState === 4 ) { if (xhr.status >= 200 && xhr.status < 300) {