comparison mrjunejune/src/tools/markdown_to_html/index.html @ 214:4c725fde6999

[MrJuneJune] Fixed linkedin path and images modules.
author MrJuneJune <me@mrjunejune.com>
date Sun, 15 Feb 2026 22:21:27 -0800
parents 8c74204fd362
children
comparison
equal deleted inserted replaced
213:60918f88070e 214:4c725fde6999
52 52
53 --- 53 ---
54 54
55 ### Images 55 ### Images
56 56
57 ![Alt text](https://via.placeholder.com/150) 57 ![Alt text](https://mrjunejune.com/public/epi_favicon.svg)
58 58
59 **Try editing this text!**</textarea> 59 **Try editing this text!**</textarea>
60 </div> 60 </div>
61 61
62 <div class="panel"> 62 <div class="panel">
66 </div> 66 </div>
67 <div id="output"></div> 67 <div id="output"></div>
68 </div> 68 </div>
69 </div> 69 </div>
70 {{/parts/footer.html}} 70 {{/parts/footer.html}}
71 <script src="/markdown_to_html_bin.js"></script> 71 <script type="module">
72 <script> 72 import createModule from '/markdown_to_html_bin.js';
73 // Wait for WASM module to be ready 73
74 Module.onRuntimeInitialized = () => { 74 // Get DOM elements
75 const input = document.getElementById('input');
76 const output = document.getElementById('output');
77 const copy = document.getElementById('copy');
78
79 // Modern Emscripten exports a factory function that returns a Promise
80 createModule().then(Module => {
75 // Get raw pointer so we can free it after use 81 // Get raw pointer so we can free it after use
76 const markdownToHtmlPtr = Module.cwrap('markdown_to_html', 'number', ['string']); 82 const markdownToHtmlPtr = Module.cwrap('markdown_to_html', 'number', ['string']);
77 const markdownFree = Module.cwrap('markdown_free', null, ['number']); 83 const markdownFree = Module.cwrap('markdown_free', null, ['number']);
78 84
79 function convert() { 85 function convert() {
106 }, 1000); 112 }, 1000);
107 }).catch(err => { 113 }).catch(err => {
108 console.error('Failed to copy: ', err); 114 console.error('Failed to copy: ', err);
109 }); 115 });
110 }); 116 });
111 }; 117 });
112 </script> 118 </script>
113 </body> 119 </body>
114 </html> 120 </html>