Only strip header from md2* formats, fix pandoc2html

pull/86/head
Matti Pastell 2017-03-14 15:34:27 +02:00
parent bbad66d0b8
commit 38d3b04363
2 changed files with 5 additions and 4 deletions

View File

@ -4,7 +4,6 @@ function format(doc::WeaveDoc)
formatted = AbstractString[]
docformat = doc.format
#Complete format dictionaries with defaults
formatdict = docformat.formatdict
get!(formatdict, :termstart, formatdict[:codestart])
@ -19,7 +18,9 @@ function format(doc::WeaveDoc)
#strip header
if isa(doc.chunks[1], DocChunk)
doc.chunks[1] = strip_header(doc.chunks[1])
if contains(doc.doctype, "md2")
doc.chunks[1] = strip_header(doc.chunks[1])
end
end
for chunk in copy(doc.chunks)

View File

@ -63,9 +63,9 @@ const pdoc2html = Pandoc("Markdown to HTML (requires Pandoc)",
:codeend=> "````\n\n",
:outputstart=> "````",
:outputend=> "````\n\n",
:fig_ext=> ".svg",
:fig_ext=> ".png",
:extension=> "md",
:mimetypes => ["image/svg+xml", "image/png", "image/jpg",
:mimetypes => ["image/png", "image/svg+xml", "image/jpg",
"text/html", "text/markdown", "text/plain"],
:doctype=> "md2html"))