Check Pandoc API version

This commit is contained in:
Lassi Kortela 2021-08-25 09:17:59 +03:00
parent 8d5bd6b1ed
commit 9172a0651b
1 changed files with 8 additions and 0 deletions

View File

@ -90,6 +90,14 @@
(define (convert-many elements)
(join-adjacent-strings (map convert-block-or-inline elements)))
(define (assert-supported-version)
(let* ((version (cdr (assq 'pandoc-api-version json)))
(major (vector-ref version 0)))
(unless (= major 1)
(error "Pandoc API version is not 1.x" version))))
(assert-supported-version)
(convert-many (vector->list (cdr (assq 'blocks json)))))
(define (pandoc-port->json input-format input-port)