diff --git a/src/Resource.jl b/src/Resource.jl index 182bff3..f50192e 100644 --- a/src/Resource.jl +++ b/src/Resource.jl @@ -101,6 +101,8 @@ function LocalResource(path::AbstractString, html_attributes::Pair...) Resource(src, mime, html_attributes) end +Vector{UInt8}(r::PlutoUI.Resource) = Base64.base64decode(split(r.src, ',', limit=2) |> last) + ### # DOWNLOAD BUTTON ### diff --git a/test/runtests.jl b/test/runtests.jl index 733fe81..8831d54 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -129,8 +129,9 @@ end occursin("https://asdf.com/a/b/c.mp4?b=23f&c=asdf.png", h4) ) @test occursin(r"asdf=[\'\"]123px", h5) - - + @test Vector{UInt8}(r3) == Vector{UInt8}("asdf") + + end @testset "DownloadButton" begin