aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-11-30 23:16:42 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2014-11-30 23:16:42 -0800
commitda0d0b693d179d1df02cc967da74fa4a5e58f121 (patch)
treee5915dc9034e4dbe91a4488aa8d5abb1b5203a5a
parent35572034f612091cdfc30d3b58326556d85a5a1c (diff)
Improved lua wrapper demo.
-rwxr-xr-xwrapper.lua10
1 files changed, 4 insertions, 6 deletions
diff --git a/wrapper.lua b/wrapper.lua
index d89ebc9..11c5183 100755
--- a/wrapper.lua
+++ b/wrapper.lua
@@ -133,7 +133,8 @@ ffi.cdef[[
]]
-local doc = cmark.cmark_parse_document("hi *there*", 10)
+local inp = io.read("*all")
+local doc = cmark.cmark_parse_document(inp, string.len(inp))
local cur = doc
local next
@@ -196,8 +197,5 @@ end
walk(print_type)
-local t1 = cmark.cmark_node_get_type(doc)
-print(t1 == cmark.CMARK_NODE_DOCUMENT)
-
-local html = ffi.string(cmark.cmark_render_html(doc))
-print(html)
+-- local html = ffi.string(cmark.cmark_render_html(doc))
+-- print(html)