cmark

My personal build of CMark ✏️

Commit
da0d0b693d179d1df02cc967da74fa4a5e58f121
Parent
35572034f612091cdfc30d3b58326556d85a5a1c
Author
John MacFarlane <jgm@berkeley.edu>
Date

Improved lua wrapper demo.

Diffstat

1 file changed, 4 insertions, 6 deletions

Status File Name N° Changes Insertions Deletions
Modified wrapper.lua 10 4 6
diff --git 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)