Skip to content

Commit

Permalink
change #' to # and require ## for regular julia comments, fix #3
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikekre committed May 3, 2018
1 parent 47ca20d commit f8f3552
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Literate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ function parse(content; allow_continued = true)

for line in lines
line = rstrip(line)
# print("line = `$line`: ")
if startswith(line, "#-") # new chunk
# assume same as last chunk, will be cleaned up otherwise
push!(chunks, typeof(chunks[end])())
Expand All @@ -53,13 +54,15 @@ function parse(content; allow_continued = true)
# remove "# " and "#\n"
line = replace(replace(line, r"^# " => ""), r"^#$" => "")
push!(chunks[end].lines, line)
# println("markdown")
else # code
if !(chunks[end] isa CodeChunk)
push!(chunks, CodeChunk())
end
# remove "## " and "##\n"
line = replace(replace(line, r"^## " => "# "), r"^##$" => "#")
push!(chunks[end].lines, line)
# println("code")
end
end

Expand Down

0 comments on commit f8f3552

Please sign in to comment.