use crate::converter::block::container::HandlerContext;
pub fn handle_caption(
node_handle: &crate::dom::NodeHandle,
parser: &crate::dom::Parser,
output: &mut String,
handler: HandlerContext<'_>,
) {
if let Some(crate::dom::Node::Tag(tag)) = node_handle.get(parser) {
let mut text = String::new();
let children = tag.children();
{
for child_handle in children.top() {
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(handler.options.strong_em_symbol);
output.push_str(&escaped_text);
output.push(handler.options.strong_em_symbol);
output.push_str("\n\n");
}
}
}