@@ -15,6 +15,8 @@ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15
15
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16
16
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17
17
]]
18
+ PANDOC_VERSION :must_be_at_least ' 2.11'
19
+
18
20
local List = require ' pandoc.List'
19
21
local utils = require ' pandoc.utils'
20
22
local stringify = utils .stringify
@@ -44,24 +46,12 @@ local citeproc
44
46
if utils .citeproc then
45
47
-- Built-in Lua function
46
48
citeproc = utils .citeproc
47
- elseif PANDOC_VERSION >= " 2.11 " then
48
- -- We use pandoc instead of pandoc- citeproc starting with pandoc 2.11
49
+ else
50
+ -- Use pandoc as a citeproc processor
49
51
citeproc = function (doc )
50
52
local opts = {' --from=json' , ' --to=json' , ' --citeproc' , ' --quiet' }
51
53
return run_json_filter (doc , ' pandoc' , opts )
52
54
end
53
- else
54
- local version = pandoc .pipe (' pandoc-citeproc' , {' --version' }, ' ' )
55
- local major , minor , patch = version :match ' pandoc%-citeproc (%d+)%.(%d+)%.?(%d*)'
56
- major , minor , patch = tonumber (major ), tonumber (minor ), tonumber (patch )
57
- local supports_quiet_flag =
58
- major > 0
59
- or minor > 14
60
- or (minor == 14 and patch >= 5 )
61
- local opts = {FORMAT , supports_quiet_flag and ' -q' or nil }
62
- citeproc = function (doc )
63
- return run_json_filter (doc , ' pandoc-citeproc' , opts )
64
- end
65
55
end
66
56
67
57
--- Resolve citations in the document by combining all bibliographies
0 commit comments