Sha256: 0322d06eb3a9c32004dcc6332bb7372b83499c002a27996f228ab56e1e5cc699

Contents?: true

Size: 316 Bytes

Versions: 54

Compression:

Stored size: 316 Bytes

Contents

#!/usr/bin/env ruby
require 'ffi'

module CMark
  extend FFI::Library
  ffi_lib ['libcmark', 'cmark']
  attach_function :cmark_markdown_to_html, [:string, :int, :int], :string
end

def markdown_to_html(s)
  len = s.bytesize
  CMark::cmark_markdown_to_html(s, len, 0)
end

STDOUT.write(markdown_to_html(ARGF.read()))

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
commonmarker-0.17.7 ext/commonmarker/cmark-upstream/wrappers/wrapper.rb
commonmarker-0.17.6 ext/commonmarker/cmark/wrappers/wrapper.rb
commonmarker-0.17.5 ext/commonmarker/cmark/wrappers/wrapper.rb
commonmarker-0.17.4 ext/commonmarker/cmark/wrappers/wrapper.rb
commonmarker-0.17.2 ext/commonmarker/cmark/wrappers/wrapper.rb
commonmarker-0.17.1 ext/commonmarker/cmark/wrappers/wrapper.rb
commonmarker-0.17.0 ext/commonmarker/cmark/wrappers/wrapper.rb
commonmarker-0.16.8 ext/commonmarker/cmark/wrappers/wrapper.rb
commonmarker-0.16.7 ext/commonmarker/cmark/wrappers/wrapper.rb
commonmarker-0.16.6 ext/commonmarker/cmark/wrappers/wrapper.rb
commonmarker-0.16.5 ext/commonmarker/cmark/wrappers/wrapper.rb
commonmarker-0.16.4 ext/commonmarker/cmark/wrappers/wrapper.rb
commonmarker-0.16.1 ext/commonmarker/cmark/wrappers/wrapper.rb
commonmarker-0.16.2 ext/commonmarker/cmark/wrappers/wrapper.rb
commonmarker-0.16.3 ext/commonmarker/cmark/wrappers/wrapper.rb
commonmarker-0.16.0 ext/commonmarker/cmark/wrappers/wrapper.rb
commonmarker-0.15.0 ext/commonmarker/cmark/wrappers/wrapper.rb
commonmarker-0.14.15 ext/commonmarker/cmark/wrappers/wrapper.rb
commonmarker-0.14.14 ext/commonmarker/cmark/wrappers/wrapper.rb
commonmarker-0.14.13 ext/commonmarker/cmark/wrappers/wrapper.rb