|
@@ -0,0 +1,24 @@
|
|
|
+<!DOCTYPE HTML>
|
|
|
+<html>
|
|
|
+ <head>
|
|
|
+ <script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script>
|
|
|
+ <script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
|
|
|
+ <script src='index.js'></script>
|
|
|
+ </head>
|
|
|
+ <body>
|
|
|
+ <textarea id='md' style='height: 700px; width: 100%;'>
|
|
|
+ </textarea>
|
|
|
+ <button id='update'>update</button>
|
|
|
+ <div id='reactMD'>
|
|
|
+ </div>
|
|
|
+ <script>
|
|
|
+ md.value = localStorage.md || '# markdown here\n'
|
|
|
+ update.onclick = () => {
|
|
|
+ localStorage.md = md.value
|
|
|
+ const ast = buildAST(md.value)
|
|
|
+ console.log(ast)
|
|
|
+ ReactDOM.render(toReact(ast, React), reactMD)
|
|
|
+ }
|
|
|
+ </script>
|
|
|
+ </body>
|
|
|
+</html>
|