From db13be44e3ceb7b3fcaa37d6918542466af30565 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki Date: Sat, 18 Apr 2020 19:18:03 +0900 Subject: [PATCH] fix no header case --- src/format.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/format.jl b/src/format.jl index 429278a..17e9983 100644 --- a/src/format.jl +++ b/src/format.jl @@ -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