Skip to content

Commit

Permalink
fix headings in Safari Reader
Browse files Browse the repository at this point in the history
  • Loading branch information
stebunovd committed Jan 14, 2024
1 parent 8cf1297 commit 2f4d842
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions static/prettify.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@ function activateAnchors() {
if (!article) {
return;
}
var headings = document.querySelectorAll('h2').forEach(function (h) {
document.querySelectorAll('h2').forEach(function (h) {
var id = h.id;
if (id) {
var a = document.createElement('a');
a.href = '#' + id;
a.className = 'anchor';
a.text = h.innerHTML;
h.innerHTML = a.outerHTML;
h.innerHTML = '<a href="#' + id + '" class="anchor"><span>' + h.textContent + '</span></a>';
}
});
}
Expand Down

0 comments on commit 2f4d842

Please sign in to comment.