fix(presets): add --failure-level ERROR to asciidoctor args

Problem: asciidoctor exits 0 even when it encounters ERROR-level
messages, so the compiler treats every run as a success and never
invokes error_parser. Errors are silently embedded as visible text
in the HTML output instead of surfacing as diagnostics.

Solution: pass --failure-level ERROR so asciidoctor exits non-zero
on errors, which triggers error_parser and surfaces diagnostics.
This commit is contained in:
Barrett Ruth 2026-03-04 14:48:12 -05:00
parent ec00648f7a
commit a2ef9a828f
2 changed files with 2 additions and 2 deletions

View file

@ -246,7 +246,7 @@ M.asciidoctor = {
ft = 'asciidoc', ft = 'asciidoc',
cmd = { 'asciidoctor' }, cmd = { 'asciidoctor' },
args = function(ctx) args = function(ctx)
return { ctx.file, '-o', ctx.output } return { '--failure-level', 'ERROR', ctx.file, '-o', ctx.output }
end, end,
output = function(ctx) output = function(ctx)
return (ctx.file:gsub('%.adoc$', '.html')) return (ctx.file:gsub('%.adoc$', '.html'))

View file

@ -467,7 +467,7 @@ describe('presets', function()
it('returns args with file and output', function() it('returns args with file and output', function()
assert.are.same( assert.are.same(
{ '/tmp/document.adoc', '-o', '/tmp/document.html' }, { '--failure-level', 'ERROR', '/tmp/document.adoc', '-o', '/tmp/document.html' },
presets.asciidoctor.args(adoc_ctx) presets.asciidoctor.args(adoc_ctx)
) )
end) end)