diff --git a/src/Literate.jl b/src/Literate.jl index b063b1c..58ba2ad 100644 --- a/src/Literate.jl +++ b/src/Literate.jl @@ -260,7 +260,8 @@ function create_configuration(inputfile; user_config, user_kwargs, type=nothing) !get(user_config, "execute", cfg["execute"]) ? ("````@example $(get(user_config, "name", replace(cfg["name"], r"\s" => "_")))" => "````") : ("````julia" => "````") - cfg["mime_extensions"] = [(MIME("image/png"), ".png"), (MIME("image/jpeg"), ".jpeg")] + cfg["mime_extensions"] = [(MIME("image/png"), ".png"), (MIME("image/jpeg"), ".jpeg"), + (MIME("image/svg+xml"), ".svg")] # Guess the package (or repository) root url edit_commit = "master" # TODO: Make this configurable like Documenter? deploy_branch = "gh-pages" # TODO: Make this configurable like Documenter? diff --git a/test/runtests.jl b/test/runtests.jl index 94bdb99..1a7ed3e 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -778,6 +778,10 @@ end end Base.show(io::IO, mime::MIME"image/jpeg", ::JPEG) = print(io, "JPEG") JPEG() #- + struct SVG end + Base.show(io::IO, mime::MIME"image/svg+xml", ::SVG) = print(io, "SVG") + SVG() + #- struct MD end Base.show(io::IO, mime::MIME"text/markdown", ::MD) = print(io, "# " * "MD") Base.show(io::IO, mime::MIME"text/html", ::MD) = @@ -805,6 +809,7 @@ end end @test occursin("```\n2×2 $(Matrix{Int}):\n 1 2\n 3 4\n```", markdown) # text/plain @test occursin(r"!\[\]\(\d+\.png\)", markdown) # image/png @test occursin(r"!\[\]\(\d+\.jpeg\)", markdown) # image/jpeg +e @test occursin(r"!\[\]\(\d+\.svg\)", markdown) # image/svg+xml, fredrikekre/Literate.jl#182 @test occursin("# MD", markdown) # text/markdown @test occursin("```@raw html\n