wrapper.rb: added argument for options.

This commit is contained in:
John MacFarlane 2015-05-06 14:31:04 -07:00
parent 8dab8b603d
commit f620758697

View File

@ -4,12 +4,12 @@ require 'ffi'
module CMark
extend FFI::Library
ffi_lib ['libcmark', 'cmark']
attach_function :cmark_markdown_to_html, [:string, :int], :string
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)
CMark::cmark_markdown_to_html(s, len, 0)
end
STDOUT.write(markdown_to_html(ARGF.read()))