Skip to content

Commit

Permalink
kwdef
Browse files Browse the repository at this point in the history
  • Loading branch information
domluna committed Sep 24, 2024
1 parent cf843f2 commit 87cd506
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/JuliaFormatter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion src/format_docstring.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 87cd506

Please sign in to comment.