blob: 857ace6ba8b0f3f0bc9d2d454073f238e13006b5 [file] [log] [blame]
{{ $url := .Get 0 }}
{{ $id := printf "__render_%v" .Ordinal }}
<div id="{{ $id }}">
Loading {{ $url }}...
</div>
<script type="text/javascript">
(function() {
function renderContent(event) {
var md = window.markdownit();
var rendered = md.render(event.target.responseText);
document.getElementById('{{ $id }}').innerHTML = rendered;
}
function loadContent(event) {
var request = new XMLHttpRequest();
request.addEventListener('load', renderContent);
request.open('GET', '{{ $url }}');
request.send();
}
window.addEventListener('load', loadContent);
})();
</script>