Skip to content

Commit

Permalink
Detecting pandoc api version
Browse files Browse the repository at this point in the history
  • Loading branch information
chdemko committed Oct 18, 2017
1 parent 70dd4c9 commit c018d70
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pandoc_numbering.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,16 @@ def applyJSONFilters(actions, source, format=""):

doc = json.loads(source)

if 'pandoc-api-version' in doc:
pandocVersion.value = doc['pandoc-api-version']

if 'meta' in doc:
meta = doc['meta']
elif doc[0]: # old API
meta = doc[0]['unMeta']
else:
meta = {}

altered = doc
for action in actions:
altered = walk(altered, action, format, meta)
Expand Down

0 comments on commit c018d70

Please sign in to comment.