use crate::converter::block::container::HandlerContext;
pub fn handle_caption(
node_handle: &tl::NodeHandle,
parser: &tl::Parser,
output: &mut String,
handler: HandlerContext<'_>,
) {
if let Some(tl::Node::Tag(tag)) = node_handle.get(parser) {
let mut text = String::new();
let children = tag.children();
{
for child_handle in children.top().iter() {
super::super::super::walk_node(
child_handle,
parser,
&mut text,
crate::converter::block::container::HandlerContext::new(
handler.options,
handler.ctx,
handler.depth + 1,
handler.dom_ctx,
),
);
}
}
let text = text.trim();
if !text.is_empty() {
let escaped_text = text.replace('-', r"\-");
output.push('*');
output.push_str(&escaped_text);
output.push_str("*\n\n");
}
}
}