Mercurial
diff 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 |
line wrap: on
line diff
--- a/mrjunejune/src/tools/markdown_to_html/index.html Sun Feb 15 21:39:43 2026 -0800 +++ b/mrjunejune/src/tools/markdown_to_html/index.html Sun Feb 15 22:21:27 2026 -0800 @@ -54,7 +54,7 @@ ### Images - + **Try editing this text!**</textarea> </div> @@ -68,10 +68,16 @@ </div> </div> {{/parts/footer.html}} - <script src="/markdown_to_html_bin.js"></script> - <script> - // Wait for WASM module to be ready - Module.onRuntimeInitialized = () => { + <script type="module"> + import createModule from '/markdown_to_html_bin.js'; + + // Get DOM elements + const input = document.getElementById('input'); + const output = document.getElementById('output'); + const copy = document.getElementById('copy'); + + // Modern Emscripten exports a factory function that returns a Promise + createModule().then(Module => { // Get raw pointer so we can free it after use const markdownToHtmlPtr = Module.cwrap('markdown_to_html', 'number', ['string']); const markdownFree = Module.cwrap('markdown_free', null, ['number']); @@ -108,7 +114,7 @@ console.error('Failed to copy: ', err); }); }); - }; + }); </script> </body> </html>