Skip to content

Commit

Permalink
avoid iterating a live nodelist (#588)
Browse files Browse the repository at this point in the history
  • Loading branch information
bakkot authored Mar 22, 2024
1 parent 7354849 commit 3ddc70b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ export default class Spec {
}

private annotateExternalLinks(): void {
for (const a of this.doc.getElementsByTagName('a')) {
for (const a of this.doc.querySelectorAll('a')) {
if (a.hostname !== '' && a.href !== a.textContent && a.protocol !== 'mailto:') {
a.setAttribute('data-print-href', '');
}
Expand Down

0 comments on commit 3ddc70b

Please sign in to comment.