diff --git a/src/chisels.jl b/src/chisels.jl index 5076da3..ca36a48 100644 --- a/src/chisels.jl +++ b/src/chisels.jl @@ -523,9 +523,8 @@ function contains_multiline_triple_string(ctx, node::Node) if endswith(String(read_bytes(ctx, kid)), "\n") return true end - else - accept_node!(ctx, kid) end + accept_node!(ctx, kid) end @assert position(ctx.fmt_io) == pos + span(node) else diff --git a/test/runtests.jl b/test/runtests.jl index fcf2e35..9ec27a2 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -715,6 +715,11 @@ end for trip in ("\"\"\"", "```") @test format_string("println(io, $(trip)\n$(sp)a\n$(sp)\n$(sp)b\n$(sp)$(trip))") == "println(\n io, $(trip)\n a\n\n b\n $(trip),\n)" + # Triple string on same line + for b in ("", "\$b", "\$(b)", "\$(b)c") + @test format_string("println(io, $(trip)a$b$(trip))") == + "println(io, $(trip)a$b$(trip))" + end end end end