Skip to content

Instantly share code, notes, and snippets.

@Xanir
Created March 7, 2019 22:52
Show Gist options
  • Save Xanir/abaad4b1d1e9250edfc6e2bc4b32bd95 to your computer and use it in GitHub Desktop.
Save Xanir/abaad4b1d1e9250edfc6e2bc4b32bd95 to your computer and use it in GitHub Desktop.
Markdown processor
<script src="https://cdnjs.cloudflare.com/ajax/libs/showdown/1.9.0/showdown.min.js"></script>
<script>
var converter = new showdown.Converter();
converter.setOption('tables', true);
converter.setOption('simpleLineBreaks', true);
converter.setOption('emoji', true);
window.renderMarkdown = function() {
var markdownInput = document.querySelector('#markdownInput').value;
var markdownElem = document.querySelector('#markdownRendered');
markdownElem.innerHTML = converter.makeHtml(markdownInput);
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment