Skip to content

Commit

Permalink
Resolves asciidoctor#35, automatically register converter and extension
Browse files Browse the repository at this point in the history
  • Loading branch information
ggrossetie committed Dec 2, 2018
1 parent d3eace9 commit a317a1e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down

0 comments on commit a317a1e

Please sign in to comment.