preserve header when weaving to Hugo markdown

pull/334/head
Shuhei Kadowaki 2020-05-16 23:31:27 +09:00
parent 58bc741b7f
commit f86f5a7bd0
1 changed files with 4 additions and 2 deletions

View File

@ -98,9 +98,11 @@ function render_doc(formatted, doc, format::JMarkdown2tex)
)
end
# TODO: is there any other format where we want to restore headers ?
const HEADER_PRESERVE_DOCTYPES = ("github", "hugo")
function restore_header!(doc)
# TODO: is there any other format where we want to restore headers ?
doc.doctype "github" && return
doc.doctype in HEADER_PRESERVE_DOCTYPES || return # don't restore
# only strips Weave headers
delete!(doc.header, WEAVE_OPTION_NAME)