From ecac19745b5a3a96755ab5129c60290cb4c338f4 Mon Sep 17 00:00:00 2001
From: Radek Czajka <rczajka@rczajka.pl>
Date: Mon, 26 Aug 2024 10:08:37 +0200
Subject: [PATCH] minor fix

---
 src/wolnelektury/static/js/book_text/references.js | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/wolnelektury/static/js/book_text/references.js b/src/wolnelektury/static/js/book_text/references.js
index 9fd69282c..1a284a0eb 100644
--- a/src/wolnelektury/static/js/book_text/references.js
+++ b/src/wolnelektury/static/js/book_text/references.js
@@ -605,6 +605,8 @@
     });
 
     $('a.anchor').on('click', function(e) {
+        // Workaround for bad TOC markers.
+        if (($this).closest('#toc').length) return;
         e.preventDefault();
 
         let sel = window.getSelection();
-- 
2.20.1