diff --git a/includes/utilities.php b/includes/utilities.php index 71e5903..47fd314 100644 --- a/includes/utilities.php +++ b/includes/utilities.php @@ -119,12 +119,11 @@ function apply_footnotes_urls_to_content($content) @$dom->loadHTML(mb_convert_encoding($content, 'HTML-ENTITIES', 'UTF-8'), LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); $links = $dom->getElementsByTagName('a'); - phpinfo(); + foreach ($links as $key => $link) { - // write_log($key); + if ($link->hasAttribute('class') && strpos($link->getAttribute('class'), 'footnote-reference') !== false) { - $link->setAttribute('id', 'footnote-' . $key + 1); - write_log($link->getAttribute('id')); + $link->setAttribute('id', 'footnote-' . ($key + 1)); } }