Browse Source

Fix single line code cells in pluto nb

pull/214/head
Sogari 3 years ago committed by Simon Christ
parent
commit
be9ae28743
  1. 5
      src/Literate.jl

5
src/Literate.jl

@ -1049,7 +1049,8 @@ function create_notebook(flavor::PlutoFlavor, chunks, config)
for line in chunk.lines for line in chunk.lines
write(io, line, '\n') write(io, line, '\n')
end end
content = String(take!(io)) seek(io, 0)
content = read(io, String)
# Compute number of expressions in the code block and perhaps wrap in begin/end # Compute number of expressions in the code block and perhaps wrap in begin/end
nexprs, idx = 0, 1 nexprs, idx = 0, 1
while true while true
@ -1063,6 +1064,8 @@ function create_notebook(flavor::PlutoFlavor, chunks, config)
foreach(l -> print(io, " ", l, '\n'), eachline(IOBuffer(content))) foreach(l -> print(io, " ", l, '\n'), eachline(IOBuffer(content)))
print(io, "end\n") print(io, "end\n")
cellCounter = formatCells(io, ionb, cellCounter, uuids, folds, fold) cellCounter = formatCells(io, ionb, cellCounter, uuids, folds, fold)
else
cellCounter = formatCells(io, ionb, cellCounter, uuids, folds, fold)
end end
end end

Loading…
Cancel
Save