domluna / JuliaFormatter.jl

An opinionated code formatter for Julia. Plot twist - the opinion is your own.
https://domluna.github.io/JuliaFormatter.jl/dev/
MIT License
579 stars 69 forks source link

`format_docstrings` break `jldoctest`s #778

Open storopoli opened 1 year ago

storopoli commented 1 year ago

jldoctests expect an empty line, e.g.:

"""
    fun() = "hello"

\`\`\`jldoctest
julia> fun()
"hello"

\`\`\`
"""
hello() = "hello"

However, upon formatting with format_docstrings = true, JuliaFormatter removes the empty line:

"""
    fun() = "hello"

\`\`\`jldoctest
julia> fun()
"hello"
\`\`\`
"""
hello() = "hello"

This causes the jldoctest to fail.

domluna commented 12 months ago

i'm guessing it's a CommonMark.jl issue but i'll verify.