diff --git a/lib/cli.js b/lib/cli.js index 724a4a6..1c2df76 100755 --- a/lib/cli.js +++ b/lib/cli.js @@ -33,7 +33,14 @@ function convertOptions (argv) { console.log('destination-dir ' + destinationDir) } if (requireLib) { - require(requireLib) + const lib = require(requireLib) + if (lib && typeof lib.register === 'function') { + // REMIND: it could be an extension or a converter. + // the register function on a converter does not take any argument + // but the register function on an extension expects one argument (the extension registry) + // Until we revisit the API for extension and converter, we pass the registry as the first argument + lib.register(asciidoctor.Extensions) + } } const verboseMode = quiet ? 0 : verbose ? 2 : 1 const attributes = []