Skip to content

Commit

Permalink
Insert video HTML tag for images ending with ".webm"
Browse files Browse the repository at this point in the history
Markdown elements like `![Alt video text](dir/video.webm)` will be inserted
with a video HTML element in a similar way to Gitlab markdown.
  • Loading branch information
Richard Palethorpe committed Jun 5, 2019
1 parent 6e35c14 commit 2ad57c8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Writers/HTMLWriter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,11 @@ 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]
mdconvert(i::Markdown.Image, parent; kwargs...) = if endswith(i.url, ".webm")
Tag(:video)[:src => i.url, :width => "800", :controls => "true", Symbol("data-title") => i.alt]
else
Tag(:img)[:src => i.url, :alt => i.alt]
end

mdconvert(i::Markdown.Italic, parent; kwargs...) = Tag(:em)(mdconvert(i.text, i; kwargs...))

Expand Down

0 comments on commit 2ad57c8

Please sign in to comment.