diff --git a/src/runestone.jl b/src/runestone.jl index 390f675..8cb0e09 100644 --- a/src/runestone.jl +++ b/src/runestone.jl @@ -1039,7 +1039,7 @@ function format_importpath(ctx::Context, node::Node) node′ = replace_first_leaf(node, spacebar) else # No whitespace, insert - @assert kind(first_leaf(node)) in KSet"Identifier @" || + @assert kind(first_leaf(node)) in KSet"Identifier @ Comment" || JuliaSyntax.is_operator(first_leaf(node)) kids′ = copy(verified_kids(node)) pushfirst!(kids′, spacebar) diff --git a/test/runtests.jl b/test/runtests.jl index e45685f..9c6a615 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -848,6 +848,8 @@ end "$(verb) A: $(a), $(b)" @test format_string("$(verb) $(sp)A: $(sp)$(a)$(sp),\n$(b)") == "$(verb) A: $(a),\n $(b)" + @test format_string("$(verb) $(sp)A: $(sp)$(a)$(sp),$(sp)# c\n$(b)") == + "$(verb) A: $(a), # c\n $(b)" end end end