diff --git a/Project.toml b/Project.toml index 0363fd37..aeb7ce78 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "PlutoUI" uuid = "7f904dfe-b85e-4ff6-b463-dae2292396a8" authors = ["Fons van der Plas "] -version = "0.7.2" +version = "0.7.3" [deps] Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" diff --git a/src/DisplayTricks.jl b/src/DisplayTricks.jl index a1e0ae16..029b77d1 100644 --- a/src/DisplayTricks.jl +++ b/src/DisplayTricks.jl @@ -43,12 +43,18 @@ This is a variant of [`Base.dump`](@ref) that returns the representation directl See also: [`Print`](@ref) and [`with_terminal`](@ref). """ -function Dump(x; maxdepth=8) - sprint() do io - dump(io, x; maxdepth=maxdepth) - end |> Text +struct Dump + x::Any + maxdepth::Integer end +Dump(x; maxdepth=8) = Dump(x, maxdepth) + +function Base.show(io::IO, ::MIME"text/plain", d::Dump) + dump(io, d.x; maxdepth=d.maxdepth) +end + + """ Show(mime::MIME, data)