protected convertToMarkdown ( League\HTMLToMarkdown\ElementInterface $element ) : string | ||
$element | League\HTMLToMarkdown\ElementInterface | |
return | string | The converted HTML as Markdown |
protected function convertToMarkdown(ElementInterface $element)
{
$tag = $element->getTagName();
// Strip nodes named in remove_nodes
$tags_to_remove = explode(' ', $this->getConfig()->getOption('remove_nodes'));
if (in_array($tag, $tags_to_remove)) {
return false;
}
$converter = $this->environment->getConverterByTag($tag);
return $converter->convert($element);
}