fix no header case

pull/305/head
Shuhei Kadowaki 2020-04-18 19:18:03 +09:00
parent 95e32c4908
commit db13be44e3
1 changed files with 2 additions and 2 deletions

View File

@ -105,9 +105,9 @@ strip_header!(doc::WeaveDoc) = strip_header!(doc.chunks[1], doc.doctype)
function strip_header!(docchunk::DocChunk, doctype)
doctype == "pandoc" && return
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 ?
if doctype != "github"
docchunk.content[1].content = if doctype != "github"
lstrip(replace(content, HEADER_REGEX => ""))
else
# only strips Weave headers