public function parseString($html)
{
/** TODO: custom markdown-extra options, e.g. titles & classes **/
// <sup id="fnref:..."><a href"#fn..." rel="footnote">...</a></sup>
// => <fnref target="..." />
$html = preg_replace('@<sup id="fnref:([^"]+)">\\s*<a href="#fn:\\1" rel="footnote">\\s*\\d+\\s*</a>\\s*</sup>@Us', '<fnref target="$1" />', $html);
// <div class="footnotes">
// <hr />
// <ol>
//
// <li id="fn:...">...</li>
// ...
//
// </ol>
// </div>
// =>
// <footnotes>
// <fn name="...">...</fn>
// ...
// </footnotes>
$html = preg_replace_callback('#<div class="footnotes">\\s*<hr />\\s*<ol>\\s*(.+)\\s*</ol>\\s*</div>#Us', array(&$this, '_makeFootnotes'), $html);
return parent::parseString($html);
}