Sha256: 64d7e25859827a18a1947fea33ed87fb5fc5d09d83c63ffc9752ed1866e74732
Contents?: true
Size: 727 Bytes
Versions: 6
Compression:
Stored size: 727 Bytes
Contents
module Coradoc::Input::HTML module Converters class Video < Base def to_coradoc(node, _state = {}) src = node["src"] id = node["id"] title = extract_title(node) attributes = Coradoc::Element::AttributeList.new options = options(node) attributes.add_named("options", options) if options.any? Coradoc::Element::Video.new(title, id: id, src: src, attributes: attributes) end def options(node) autoplay = node["autoplay"] loop_attr = node["loop"] controls = node["controls"] [autoplay, loop_attr, controls].compact end end register :video, Video.new end end
Version data entries
6 entries across 6 versions & 1 rubygems