Skip to content

Commit ba52824

Browse files
authored
fix: adjust to IJulia changes (#2209)
1 parent f97729d commit ba52824

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/PrettyPrinting.jl

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -262,18 +262,26 @@ macro enable_all_show_via_expressify(T)
262262
AbstractAlgebra.show_via_expressify(io, mi, x)
263263
end
264264

265-
function Base.show(io::IO, mi::MIME"text/latex", x::$(esc(T)))
265+
function Base.showable(mi::MIME"text/latex", x::$(esc(T)))
266266
if isdefined(Main, :IJulia) && Main.IJulia.inited
267-
error("Dummy error for jupyter")
267+
return false
268268
end
269+
return true
270+
end
271+
272+
function Base.show(io::IO, mi::MIME"text/latex", x::$(esc(T)))
269273
return AbstractAlgebra.show_via_expressify(io, mi, x)
270274
end
271275

272-
function Base.show(io::IO, mi::MIME"text/html", x::$(esc(T)))
276+
function Base.showable(mi::MIME"text/html", x::$(esc(T)))
273277
if isdefined(Main, :IJulia) && Main.IJulia.inited &&
274278
!AbstractAlgebra.get_html_as_latex()
275-
error("Dummy error for jupyter")
279+
return false
276280
end
281+
return true
282+
end
283+
284+
function Base.show(io::IO, mi::MIME"text/html", x::$(esc(T)))
277285
return AbstractAlgebra.show_via_expressify(io, mi, x)
278286
end
279287
end

0 commit comments

Comments
 (0)