jgm/djot.lua

pandoc with djot-reader.lua can't process lists (and some other blocks)

xxxserxxx opened this issue · 3 comments

Environment

  • pandoc 2.18
  • djot-reader.lua from github eb900c6
  • djot 0.2.0-1 with luarocks:
   djot 0.2.0-1 depends on lua >= 5.1 (5.4-1 provided by VM)
   djot 0.2.0-1 is now installed in /usr (license: MIT)

Reproduce

Sample:

This is a test

- This is a single list item

Output:

$ pandoc -f djot-reader.lua -t html test.dj
Error running Lua:
djot-reader.lua:223: bad argument #1 to 'gsub' (string expected, got nil)
stack traceback:
        djot-reader.lua:223: in function <djot-reader.lua:208>
        (...tail calls...)
        djot-reader.lua:98: in method 'render_children'
        djot-reader.lua:111: in function <djot-reader.lua:108>
        (...tail calls...)

A variety of other markup (headings, quotes, blockquotes, most inline markup, divs) cause no problems; the items which I've found that generate errors are:

  • Bullet and numbered lists
  • Pipe tables (same error, different line in djot-reader.lua)
  • Definition lists
  • The only inline markup I've found that causes an error are symbols

I haven't tried everything; most of the issues appear to be blocks, but not all block formatting has issues.

jgm commented

Try installing the dev version of djot.lua and using the version of pandoc-reader.lua there.
Clone the repository and then:

% luarocks make
% pandoc -f pandoc-reader.lua
This is a test

- This is a single list item
<p>This is a test</p>
<ul>
<li>This is a single list item</li>
</ul>

For anyone else who's not a Lua dev, you first have to run 'make' in the fresh clone; otherwise, luarocks will fail.

Yes, the dev version does work, thank you!

jgm commented

I'll push a new version of the rock to the luarocks repository.