File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 11-- lua filter for spell checking: requires 'aspell'.
22-- Copyright (C) 2017-2020 John MacFarlane, released under MIT license
33
4+ -- pandoc.utils.stringify works on MetaValue elements since pandoc 2.1
5+ if PANDOC_VERSION == nil then -- if pandoc_version < 2.1
6+ error (" ERROR: pandoc >= 2.1 required for spellcheck.lua filter" )
7+ end
8+
49local text = require (' text' )
510local words = {}
611local deflang
@@ -15,10 +20,7 @@ local function add_to_dict(lang, t)
1520end
1621
1722local function get_deflang (meta )
18- deflang = (meta .lang and meta .lang [1 ] and meta .lang [1 ].c ) or ' en'
19- -- the following is better but won't work in pandoc 2.0.6.
20- -- it requires pandoc commit ecc46e229fde934f163d1f646383d24bfe2039e1:
21- -- deflang = (meta.lang and pandoc.utils.stringify(meta.lang)) or 'en'
23+ deflang = (meta .lang and pandoc .utils .stringify (meta .lang )) or ' en'
2224 return {} -- eliminate meta so it doesn't get spellchecked
2325end
2426
You can’t perform that action at this time.
0 commit comments