Skip to content

Commit

Permalink
Ensure Blocks in documents when normalizing draft posts
Browse files Browse the repository at this point in the history
The `blocks` property of a Pandoc object should always contain an object
of type `Blocks`.
  • Loading branch information
tarleb committed Dec 11, 2024
1 parent 557b5f3 commit 3a0dc9e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/resources/filters/normalize/draft.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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", '<meta name="quarto:status" content="' .. kDraftStatusRemove .. '">')
return pandoc
return doc
elseif is_draft and draft_mode ~= kDraftModeGone then
quarto.doc.includeText("in-header", '<meta name="quarto:status" content="' .. kDraftStatusDraft .. '">')
return pandoc
return doc
end
end
end
}
end
end

0 comments on commit 3a0dc9e

Please sign in to comment.