/** * Handle a node * * Handle / transform a given node, and return the result of the * conversion. * * @param ezcDocumentElementVisitorConverter $converter * @param DOMElement $node * @param mixed $root * @return mixed */ public function handle(ezcDocumentElementVisitorConverter $converter, DOMElement $node, $root) { $footnoteContent = trim($converter->visitChildren($node, '')); $number = $converter->appendFootnote($footnoteContent); // Add autonumbered footnote reference $root .= '[#]_ '; return $root; }
/** * Handle a node * * Handle / transform a given node, and return the result of the * conversion. * * @param ezcDocumentElementVisitorConverter $converter * @param DOMElement $node * @param mixed $root * @return mixed */ public function handle(ezcDocumentElementVisitorConverter $converter, DOMElement $node, $root) { $number = $converter->appendFootnote($node->cloneNode(true)); $footnoteReference = $root->ownerDocument->createElement('a', $number); $footnoteReference->setAttribute('class', 'footnote'); $footnoteReference->setAttribute('href', '#__footnote_' . $number); $root->appendChild($footnoteReference); return $root; }