diff --git a/assets/html/documenter.css b/assets/html/documenter.css index 7cd26628de8..d1f8049696c 100644 --- a/assets/html/documenter.css +++ b/assets/html/documenter.css @@ -83,6 +83,10 @@ img { max-width: 100%; } +video { + max-width: 100%; +} + table { border-collapse: collapse; margin: 1em 0; diff --git a/src/Writers/HTMLWriter.jl b/src/Writers/HTMLWriter.jl index 27263341922..ee3465dc4f8 100644 --- a/src/Writers/HTMLWriter.jl +++ b/src/Writers/HTMLWriter.jl @@ -1030,7 +1030,17 @@ mdconvert(h::Markdown.Header{N}, parent; kwargs...) where {N} = DOM.Tag(Symbol(" mdconvert(::Markdown.HorizontalRule, parent; kwargs...) = Tag(:hr)() -mdconvert(i::Markdown.Image, parent; kwargs...) = Tag(:img)[:src => i.url, :alt => i.alt] +function mdconvert(i::Markdown.Image, parent; kwargs...) + @tags video img a + + if occursin(r"(.webm|.mp4|.ogg|.ogm|.ogv|.avi)$", i.url) + video[:src => i.url, :controls => "true", :title => i.alt]( + a[:href => i.url](i.alt) + ) + else + img[:src => i.url, :alt => i.alt] + end +end mdconvert(i::Markdown.Italic, parent; kwargs...) = Tag(:em)(mdconvert(i.text, i; kwargs...))