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 1
1
-- lua filter for spell checking: requires 'aspell'.
2
2
-- Copyright (C) 2017-2020 John MacFarlane, released under MIT license
3
3
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
+
4
9
local text = require (' text' )
5
10
local words = {}
6
11
local deflang
@@ -15,10 +20,7 @@ local function add_to_dict(lang, t)
15
20
end
16
21
17
22
local 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'
22
24
return {} -- eliminate meta so it doesn't get spellchecked
23
25
end
24
26
You can’t perform that action at this time.
0 commit comments