Check Pandoc API version
This commit is contained in:
parent
8d5bd6b1ed
commit
9172a0651b
|
@ -90,6 +90,14 @@
|
||||||
|
|
||||||
(define (convert-many elements)
|
(define (convert-many elements)
|
||||||
(join-adjacent-strings (map convert-block-or-inline 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)))))
|
(convert-many (vector->list (cdr (assq 'blocks json)))))
|
||||||
|
|
||||||
(define (pandoc-port->json input-format input-port)
|
(define (pandoc-port->json input-format input-port)
|
||||||
|
|
Loading…
Reference in New Issue