Sha256: 1a2f96e63a1b6bd7398ec2ab1dc0d4db54f1acdbb6fbddbf571d9e2b91dca2bf
Contents?: true
Size: 691 Bytes
Versions: 67
Compression:
Stored size: 691 Bytes
Contents
// Define one global function that renders markdown. (function() { // Grab functions from emscripten var Pointer_stringify = Module.Pointer_stringify; var _str_to_html = Module._str_to_html; var malloc = Module._malloc; var realloc = Module._realloc; var writeStringToMemory = Module.writeStringToMemory; var allocSize = 2048; var pointer = malloc( allocSize ) ; window.md_to_html = function( text ) { var textLength = text.length; while ( textLength > allocSize ) { allocSize <<= 1; // double pointer = realloc( pointer, allocSize ); } writeStringToMemory( text, pointer ); return Pointer_stringify( _str_to_html( pointer ) ); }; })();
Version data entries
67 entries across 67 versions & 2 rubygems