@@ -15,6 +15,8 @@ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
1515ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
1616OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1717]]
18+ PANDOC_VERSION :must_be_at_least ' 2.11'
19+
1820local List = require ' pandoc.List'
1921local utils = require ' pandoc.utils'
2022local stringify = utils .stringify
@@ -44,24 +46,12 @@ local citeproc
4446if utils .citeproc then
4547 -- Built-in Lua function
4648 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
4951 citeproc = function (doc )
5052 local opts = {' --from=json' , ' --to=json' , ' --citeproc' , ' --quiet' }
5153 return run_json_filter (doc , ' pandoc' , opts )
5254 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
6555end
6656
6757--- Resolve citations in the document by combining all bibliographies
0 commit comments