diff --git a/src/formatters.jl b/src/formatters.jl index befe863..b39710a 100644 --- a/src/formatters.jl +++ b/src/formatters.jl @@ -434,7 +434,7 @@ function formatfigures(chunk, docformat::Hugo) end "{{< figure src=\"$(joinpath(relpath, fig))\" $(title_spec) >}}" end - mapreduce(format_shortcode, *, "", enumerate(chunk.figures)) + mapreduce(format_shortcode, *, enumerate(chunk.figures), init="") end function formatfigures(chunk, docformat::MultiMarkdown) diff --git a/src/readers.jl b/src/readers.jl index 63d593a..9ca18a9 100644 --- a/src/readers.jl +++ b/src/readers.jl @@ -158,7 +158,7 @@ end """Parse .jl scripts with Weave.jl markup""" function parse_doc(document::AbstractString, format::ScriptInput) - document = replace(document, "\r\n", "\n") + document = replace(document, "\r\n" => "\n") lines = split(document, "\n") doc_line = format.doc_line @@ -184,9 +184,9 @@ function parse_doc(document::AbstractString, format::ScriptInput) for lineno in 1:length(lines) line = lines[lineno] if (m = match(doc_line, line)) != nothing && (m = match(opt_line, line)) == nothing - line = replace(line, doc_start, "", 1) + line = replace(line, doc_start => "", count=1) if startswith(line, " ") - line = replace(line, " ", "", 1) + line = replace(line, " " => "", count=1) end if state == "code" && strip(read) != "" chunk = CodeChunk("\n" * strip(read), codeno, start_line, optionString, options) @@ -212,7 +212,7 @@ function parse_doc(document::AbstractString, format::ScriptInput) docno += 1 end - optionString = replace(line, opt_start, "", 1) + optionString = replace(line, opt_start => "", count=1) #Get options options = Dict{Symbol,Any}() if length(optionString) > 0 diff --git a/src/run.jl b/src/run.jl index 97d18d1..87dced3 100644 --- a/src/run.jl +++ b/src/run.jl @@ -40,7 +40,7 @@ function Base.run(doc::WeaveDoc; doctype = :auto, plotlib=:auto, cache == :off || @eval import FileIO, JLD2 #This is needed for latex and should work on all output formats - Sys.iswindows() && (fig_path = replace(fig_path, "\\", "/")) + Sys.iswindows() && (fig_path = replace(fig_path, "\\" => "/")) doc.fig_path = fig_path set_rc_params(doc.format.formatdict, fig_path, fig_ext)