diff options
author | Emile 'iMil' Heitor <imil@NetBSD.org> | 2013-07-23 17:31:30 +0200 |
---|---|---|
committer | Emile 'iMil' Heitor <imil@NetBSD.org> | 2013-07-23 17:31:30 +0200 |
commit | ce0facf7b24bd43e8ca6e77f69fd2c651b840341 (patch) | |
tree | e75c716964f1650dd2f0fc353bc8189b466d3068 /plugin | |
parent | 7d19b4f7ce2ab3fd7880d0f60b1c147d44808f0c (diff) | |
download | fosdem-2018-presentation-ce0facf7b24bd43e8ca6e77f69fd2c651b840341.tar fosdem-2018-presentation-ce0facf7b24bd43e8ca6e77f69fd2c651b840341.tar.gz |
added custom charset support for external markdown file
Diffstat (limited to 'plugin')
-rwxr-xr-x | plugin/markdown/markdown.js | 6 |
1 files changed, 6 insertions, 0 deletions
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) { |