diff --git a/src/Expanders.jl b/src/Expanders.jl index 6a087a2506d..582f936f941 100644 --- a/src/Expanders.jl +++ b/src/Expanders.jl @@ -540,7 +540,7 @@ function Selectors.runner(::Type{ExampleBlocks}, x, page, doc) # "parse" keyword arguments to example continued = false - ansicolor = get(stdout, :color, false)::Bool + ansicolor = Base.JLOptions().color != 2 # disable if --color=no if kwargs !== nothing continued = occursin(r"\bcontinued\s*=\s*true\b", kwargs) matched = match(r"\bansicolor\s*=\s*(true|false)\b", kwargs) @@ -614,7 +614,7 @@ function Selectors.runner(::Type{REPLBlocks}, x, page, doc) mod = Utilities.get_sandbox_module!(page.globals.meta, "atexample", name) # "parse" keyword arguments to repl - ansicolor = get(stdout, :color, false)::Bool + ansicolor = Base.JLOptions().color != 2 # disable if --color=no if kwargs !== nothing matched = match(r"\bansicolor\s*=\s*(true|false)\b", kwargs) if matched !== nothing