mirror of https://github.com/mpastell/Weave.jl
fix no header case
parent
95e32c4908
commit
db13be44e3
|
@ -105,9 +105,9 @@ strip_header!(doc::WeaveDoc) = strip_header!(doc.chunks[1], doc.doctype)
|
||||||
function strip_header!(docchunk::DocChunk, doctype)
|
function strip_header!(docchunk::DocChunk, doctype)
|
||||||
doctype == "pandoc" && return
|
doctype == "pandoc" && return
|
||||||
content = docchunk.content[1].content
|
content = docchunk.content[1].content
|
||||||
docchunk.content[1].content = if (m = match(HEADER_REGEX, content)) !== nothing
|
if (m = match(HEADER_REGEX, content)) !== nothing
|
||||||
# TODO: is there other format where we want to keep headers ?
|
# TODO: is there other format where we want to keep headers ?
|
||||||
if doctype != "github"
|
docchunk.content[1].content = if doctype != "github"
|
||||||
lstrip(replace(content, HEADER_REGEX => ""))
|
lstrip(replace(content, HEADER_REGEX => ""))
|
||||||
else
|
else
|
||||||
# only strips Weave headers
|
# only strips Weave headers
|
||||||
|
|
Loading…
Reference in New Issue