Project reorganization, add editorconfig and linter

This commit is contained in:
Ludwig Schubert
2017-08-09 16:47:35 -07:00
parent 07c7527734
commit 11eda0fc49
75 changed files with 1120 additions and 17117 deletions
+20
View File
@@ -0,0 +1,20 @@
import marked from 'marked';
marked.setOptions({
gfm: true,
smartypants: true
});
export default function(dom, data) {
let markdownElements = [].slice.call(dom.querySelectorAll('[markdown]'));
markdownElements.forEach(el => {
let content = el.innerHTML;
// Set default indents
content = content.replace(/\n/, "");
let tabs = content.match(/\s*/);
content = content.replace(new RegExp("\n" + tabs, "g"), "\n");
content = content.trim();
el.innerHTML = marked(content);
});
}