Wed, 08 Jul 2026 19:48:16 +0300
Fix issue with a const variable assign in lua 5.5
| 16 | 1 | local pandoc={} |
| 2 | ||
| 3 | local io = require('io') | |
| 4 | local os = require('os') | |
| 5 | ||
| 6 | function pandoc.pandoc(str) | |
| 7 | -- Lua doesn't have bidirectional pipes without the posix library. | |
| 8 | -- Keep things and compatible and use temporary files. | |
| 9 | tmpname = os.tmpname() | |
| 10 | file = io.open(tmpname, 'w') | |
| 11 | file:write(str) | |
| 12 | cmd = 'pandoc --from=markdown --to=html "' .. tmpname .. '"' | |
| 39 | 13 | -- io.stdout:write('Executing ' .. cmd .. '\n') |
| 16 | 14 | h = io.popen(cmd, 'r') |
| 15 | result = h:read("*a") | |
| 16 | h:close() | |
| 17 | file:close() | |
| 18 | return result | |
| 19 | end | |
| 20 | ||
| 21 | return pandoc |