Skip to content
Snippets Groups Projects
Commit ff567372 authored by Hakim El Hattab's avatar Hakim El Hattab
Browse files

self-execute data-markdown

parent 12c9977c
Branches
No related tags found
No related merge requests found
// From https://gist.github.com/1343518, modified to not load showdown
(function boom(){
(function(){
[].forEach.call( document.querySelectorAll('[data-markdown]'), function fn(elem){
// strip leading whitespace so it isn't evaluated as code
var text = elem.innerHTML.replace(/\n\s*\n/g,'\n'),
// set indentation level so your markdown can be indented within your HTML
......@@ -16,4 +16,4 @@
});
}());
\ No newline at end of file
})();
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment