From 3a0dc9ea6ef904277364aae7844a75384bd380c1 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Tue, 26 Nov 2024 21:03:34 +0100 Subject: [PATCH] Ensure Blocks in documents when normalizing draft posts The `blocks` property of a Pandoc object should always contain an object of type `Blocks`. --- src/resources/filters/normalize/draft.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/resources/filters/normalize/draft.lua b/src/resources/filters/normalize/draft.lua index 7b9c718a18..d3f043e643 100644 --- a/src/resources/filters/normalize/draft.lua +++ b/src/resources/filters/normalize/draft.lua @@ -23,17 +23,17 @@ function normalize_draft() end is_draft = meta[kDraft] == true or tcontains(drafts, quarto.doc.input_file); end, - Pandoc = function(pandoc) + Pandoc = function(doc) if _quarto.format.isHtmlOutput() and not _quarto.format.isHtmlSlideOutput() then if is_draft and draft_mode == kDraftModeGone then - pandoc.blocks = {} + doc.blocks = pandoc.Blocks{} quarto.doc.includeText("in-header", '') - return pandoc + return doc elseif is_draft and draft_mode ~= kDraftModeGone then quarto.doc.includeText("in-header", '') - return pandoc + return doc end end end } -end \ No newline at end of file +end