Preserve whitespace when stripping the header

pull/66/head
Matti Pastell 2016-12-15 12:39:41 +02:00
parent 84dbf05b3e
commit 606bf9147f
3 changed files with 5 additions and 1 deletions

View File

@ -90,7 +90,9 @@ function get_titleblock(doc::WeaveDoc)
end
function strip_header(chunk::DocChunk)
chunk.content = lstrip(replace(chunk.content, r"^---$(?<header>.+)^---$"ms, ""))
if ismatch(r"^---$(?<header>.+)^---$"ms, chunk.content)
chunk.content = lstrip(replace(chunk.content, r"^---$(?<header>.+)^---$"ms, ""))
end
return chunk
end

View File

@ -1,4 +1,5 @@
~~~~{.julia}
using DataFrames
df = DataFrame(letters = 'a':'z', numbers = 1:26)

View File

@ -1,4 +1,5 @@
\begin{juliacode}
using DataFrames
df = DataFrame(letters = 'a':'z', numbers = 1:26)