diff --git a/src/JuliaFormatter.jl b/src/JuliaFormatter.jl index bc486c11..f29069f8 100644 --- a/src/JuliaFormatter.jl +++ b/src/JuliaFormatter.jl @@ -5,7 +5,7 @@ using JuliaSyntax: haschildren, children, span, @K_str, kind, @KSet_str using TOML: parsefile using Glob import CommonMark: block_modifier -import Base: get, pairs, show, push! +import Base: get, pairs, show, push!, @kwdef using CommonMark: AdmonitionRule, CodeBlock, diff --git a/src/format_docstring.jl b/src/format_docstring.jl index cad1d1f9..4b9d0fb0 100644 --- a/src/format_docstring.jl +++ b/src/format_docstring.jl @@ -6,7 +6,8 @@ format_text(text::AbstractString, fr::FormatRule) = format_text(text, fr.style, function block_modifier(rule::FormatRule) Rule(1) do _, block - if block.t isa CodeBlock && startswith(block.t.info, r"@example|@repl|@eval|julia|{julia}|jldoctest") + if block.t isa CodeBlock && + startswith(block.t.info, r"@example|@repl|@eval|julia|{julia}|jldoctest") code = block.literal::String block.literal = if occursin(r"^julia> "m, code)