fix incorrect folder name for julia-0.6.x
Former-commit-id: ef2c7401e0876f22d2f7762d182cfbcd5a7d9c70
This commit is contained in:
30
julia-0.6.3/share/julia/base/markdown/render/rich.jl
Normal file
30
julia-0.6.3/share/julia/base/markdown/render/rich.jl
Normal file
@@ -0,0 +1,30 @@
|
||||
# This file is a part of Julia. License is MIT: https://julialang.org/license
|
||||
|
||||
function tohtml(io::IO, m::MIME"text/html", x)
|
||||
show(io, m, x)
|
||||
end
|
||||
|
||||
function tohtml(io::IO, m::MIME"text/plain", x)
|
||||
htmlesc(io, sprint(show, m, x))
|
||||
end
|
||||
|
||||
function tohtml(io::IO, m::MIME"image/png", img)
|
||||
print(io, """<img src="data:image/png;base64,""")
|
||||
print(io, stringmime(m, img))
|
||||
print(io, "\" />")
|
||||
end
|
||||
|
||||
function tohtml(io::IO, m::MIME"image/svg+xml", img)
|
||||
show(io, m, img)
|
||||
end
|
||||
|
||||
# Display infrastructure
|
||||
|
||||
function bestmime(val)
|
||||
for mime in ("text/html", "image/svg+xml", "image/png", "text/plain")
|
||||
mimewritable(mime, val) && return MIME(Symbol(mime))
|
||||
end
|
||||
error("Cannot render $val to Markdown.")
|
||||
end
|
||||
|
||||
tohtml(io::IO, x) = tohtml(io, bestmime(x), x)
|
||||
Reference in New Issue
Block a user