From: Emile 'iMil' Heitor Date: Tue, 23 Jul 2013 15:31:30 +0000 (+0200) Subject: added custom charset support for external markdown file X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ce0facf7b24bd43e8ca6e77f69fd2c651b840341;p=reveal.js.git added custom charset support for external markdown file --- diff --git a/plugin/markdown/markdown.js b/plugin/markdown/markdown.js index 473666b..9681cf1 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) {