pub mod embedded;
pub mod graphic;
pub mod image;
pub mod svg;
pub use super::{Context, DomContext};
#[cfg(feature = "inline-images")]
pub use image::handle_inline_data_image;
pub fn dispatch_media_handler(
tag_name: &str,
node_handle: &tl::NodeHandle,
parser: &tl::Parser,
output: &mut String,
options: &crate::options::ConversionOptions,
ctx: &super::Context,
depth: usize,
dom_ctx: &super::DomContext,
) -> bool {
let Some(node) = node_handle.get(parser) else {
return false;
};
let tag = match node {
tl::Node::Tag(tag) => tag,
_ => return false,
};
match tag_name {
"iframe" => {
embedded::handle_iframe(tag, output, ctx);
true
}
"video" => {
embedded::handle_video(node_handle, tag, parser, output, options, ctx, depth, dom_ctx);
true
}
"audio" => {
embedded::handle_audio(node_handle, tag, parser, output, options, ctx, depth, dom_ctx);
true
}
"picture" => {
embedded::handle_picture(node_handle, tag, parser, output, options, ctx, depth, dom_ctx);
true
}
"svg" => {
svg::handle_svg(node_handle, tag, parser, output, options, ctx, depth, dom_ctx);
true
}
"math" => {
svg::handle_math(node_handle, tag, parser, output, options, ctx, depth, dom_ctx);
true
}
_ => false,
}
}