Closed nrnrnr closed 4 years ago
read
returns a new Pandoc document, as the input could also contain metadata. The blocks
field should give the list of Blocks.
Type information for module functions got lost when we first converted documentation from the source into markdown. I'll consider this issue my reminder to fix this.
I think I misread your question. This does look weird. I'll take a look later.
I tested with pandoc 2.4 and 2.5, both gave the expected result. How was pandoc installed on your machine? I remember seeing similar things happen when I compiled against the wrong Lua version. Could that be the case?
Update: while trying to provide more information for you, I ran the filter on a different computer, and everything is fine. On the good computer, I am running a pandoc from a Debian package. On the bad computer, I am running a pandoc built with cabal install pandoc
.
I've now tried two more machines and have confirmed that in our production environment, function pandoc.read
works as advertised.
Please let me know if you'd like to try to track down the fault in my Cabal installation, to see if there is anything to be learned there, or if it's better just to close the issue.
It is good to hear that it works on most systems. I probably won't have the time to look into the failing case in detail, there are too many things that influence the build. It is ok for me to close this.
The new documentation from #31 is very helpful. But I am having trouble getting
pandoc.read
to return something that contains a list of blocks. There is a Lua table there, but the keys look like large negative integers, andipairs
does not produce the blocks. Also indexingblocks[1]
returns nil.Here is a minimal working example filter that demonstrates the issue:
I ran this by
pandoc --lua-filter=./read-trouble < /dev/null
, getting this output:Pandoc has this to say about its version: