mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-12-27 03:10:50 +00:00
Fix "[object HTMLCollection] is not iterable!" error in some browsers
This commit is contained in:
parent
0a3baec5b6
commit
7863eec366
1 changed files with 2 additions and 1 deletions
|
@ -792,7 +792,8 @@ const anchorForId = id => {
|
|||
const linkifyAnchors = (level, containingElement) => {
|
||||
const headers = containingElement.getElementsByTagName(`h${level}`);
|
||||
|
||||
for (const header of headers) {
|
||||
for (let i = 0, l = headers.length; i < l; i++) {
|
||||
let header = headers[i];
|
||||
if (header.getElementsByClassName("anchor").length == 0) {
|
||||
if (typeof header.id == "undefined" || header.id == "") {
|
||||
//to escape characters not allow in css and humanize
|
||||
|
|
Loading…
Reference in a new issue