Last active
October 12, 2017 18:16
-
-
Save lotz84/37c568f834fc52474e78 to your computer and use it in GitHub Desktop.
Simple markdown editor on browser, which extends "data:text/html,<html contenteditable>".
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data:text/html,<title>md</title><script src='http://cdnjs.cloudflare.com/ajax/libs/marked/0.3.2/marked.min.js'></script><style>#a,#b{width:50%;height:100%;float:left;outline:none}@media print{#a{display:none;}}</style><div id='a' contenteditable>md</div><div id='b'></div><script>var c=function(a){return document.getElementById(a)};c('a').addEventListener('keydown',function(e){if(e.keyCode==9){e.preventDefault();document.execCommand('insertText',![],'\t');return ![];}setTimeout(function(){c('b').innerHTML=marked(c('a').innerText)},0)})</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use as URL and bookmark.