Skip to content

Commit 7863eec

Browse files
committed
Fix "[object HTMLCollection] is not iterable!" error in some browsers
1 parent 0a3baec commit 7863eec

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

public/js/extra.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,8 @@ const anchorForId = id => {
792792
const linkifyAnchors = (level, containingElement) => {
793793
const headers = containingElement.getElementsByTagName(`h${level}`);
794794

795-
for (const header of headers) {
795+
for (let i = 0, l = headers.length; i < l; i++) {
796+
let header = headers[i];
796797
if (header.getElementsByClassName("anchor").length == 0) {
797798
if (typeof header.id == "undefined" || header.id == "") {
798799
//to escape characters not allow in css and humanize

0 commit comments

Comments
 (0)