8 -- Keep things and compatible and use temporary files. |
8 -- Keep things and compatible and use temporary files. |
9 tmpname = os.tmpname() |
9 tmpname = os.tmpname() |
10 file = io.open(tmpname, 'w') |
10 file = io.open(tmpname, 'w') |
11 file:write(str) |
11 file:write(str) |
12 cmd = 'pandoc --from=markdown --to=html "' .. tmpname .. '"' |
12 cmd = 'pandoc --from=markdown --to=html "' .. tmpname .. '"' |
13 io.stdout:write('Executing ' .. cmd .. '\n') |
13 -- io.stdout:write('Executing ' .. cmd .. '\n') |
14 h = io.popen(cmd, 'r') |
14 h = io.popen(cmd, 'r') |
15 result = h:read("*a") |
15 result = h:read("*a") |
16 h:close() |
16 h:close() |
17 file:close() |
17 file:close() |
18 return result |
18 return result |