Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Insert video HTML tag for images ending with ".webm" #1034

Merged
merged 4 commits into from
Jun 16, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions assets/html/documenter.css
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ img {
max-width: 100%;
}

video {
max-width: 100%;
}

table {
border-collapse: collapse;
margin: 1em 0;
Expand Down
12 changes: 11 additions & 1 deletion src/Writers/HTMLWriter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
mortenpi marked this conversation as resolved.
Show resolved Hide resolved
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...))

Expand Down