jgm / djot.js

JavaScript implementation of djot
MIT License
141 stars 15 forks source link

Update pandoc API version emitted #54

Closed tbdalgaard closed 1 year ago

tbdalgaard commented 1 year ago

Tried to convert a djot file to another format via Pandoc. My command was: djot -f djot -t pandoc mydoc.dj | pandoc -f json -t html -s -o mydoc.html

I got the following error: JSON parse error: Error in $: Incompatible API versions: encoded with [1,22,2,1] but attempted to decode with [1,23].

I have reinstalled node.js and tried to remove the old djot GitHub project installation I had, but it seems to be broken anyways. Hope you can help me out on this.

jgm commented 1 year ago

This is because recent versions of pandoc are compiled against pandoc-types 1.23. I should update the API version emitted by this tool! If you want to fix it yourself, src/pandoc.ts at line 454

jgm commented 1 year ago

The main changes in 1.23 are:

I will try to change this when I can find a moment.

tbdalgaard commented 1 year ago

Thanks for this quick fix. Would you mind update the version of Djot on NPM? There seems to be only references on how to install djot via NPM and not from this source.

jgm commented 1 year ago

done