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

Version Path
gollum-4.1.4 lib/gollum/public/gollum/livepreview/js/md_sundown.js
gollum-4.1.3 lib/gollum/public/gollum/livepreview/js/md_sundown.js
inc_gollum-4.1.2d lib/gollum/public/gollum/livepreview/js/md_sundown.js
inc_gollum-4.1.2c lib/gollum/public/gollum/livepreview/js/md_sundown.js
gollum-4.1.2 lib/gollum/public/gollum/livepreview/js/md_sundown.js
gollum-4.1.1 lib/gollum/public/gollum/livepreview/js/md_sundown.js
gollum-4.1.0 lib/gollum/public/gollum/livepreview/js/md_sundown.js
gollum-4.0.1 lib/gollum/public/gollum/livepreview/js/md_sundown.js
gollum-4.0.0 lib/gollum/public/gollum/livepreview/js/md_sundown.js
gollum-3.1.3 lib/gollum/public/gollum/livepreview/js/md_sundown.js
gollum-3.1.2 lib/gollum/public/gollum/livepreview/js/md_sundown.js
gollum-3.1.1 lib/gollum/public/gollum/livepreview/js/md_sundown.js
gollum-3.1.0 lib/gollum/public/gollum/livepreview/js/md_sundown.js
gollum-3.0.0 lib/gollum/public/gollum/livepreview/js/md_sundown.js
gollum-2.7.0 lib/gollum/public/gollum/livepreview/js/md_sundown.js
gollum-2.6.0 lib/gollum/public/gollum/livepreview/js/md_sundown.js
gollum-2.5.2 lib/gollum/public/gollum/livepreview/js/md_sundown.js
gollum-2.5.1 lib/gollum/public/gollum/livepreview/js/md_sundown.js
gollum-2.5.0 lib/gollum/public/gollum/livepreview/js/md_sundown.js
gollum-2.4.15 lib/gollum/public/gollum/livepreview/js/md_sundown.js