aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/lib/scripts/page.js
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2023-06-01 16:53:38 +0200
committerAndreas Gohr <andi@splitbrain.org>2023-06-01 16:53:38 +0200
commit68253c2bb8d5510451aa80bb7b29f7bc4d790a70 (patch)
treedbdc2101185ed79056cb087edd0bb2e5a15b3d78 /lib/scripts/page.js
parentec2224d941b26a4b80fc629c6a6e5e728cf3d9b3 (diff)
downloaddokuwiki-68253c2bb8d5510451aa80bb7b29f7bc4d790a70.tar.gz
dokuwiki-68253c2bb8d5510451aa80bb7b29f7bc4d790a70.zip
be more defensive when matching for section highlight
Diffstat (limited to 'lib/scripts/page.js')
-rw-r--r--lib/scripts/page.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/scripts/page.js b/lib/scripts/page.js
index baacee238..0bb75b961 100644
--- a/lib/scripts/page.js
+++ b/lib/scripts/page.js
@@ -26,7 +26,9 @@ dw_page = {
*/
.each(function () {
let $tgt = jQuery(this).parent();
- const nr = $tgt.attr('class').match(/(\s+|^)editbutton_(\d+)(\s+|$)/)[2];
+ const match = $tgt.attr('class').match(/(\s+|^)editbutton_(\d+)(\s+|$)/);
+ if(!match) return;
+ const nr = match[2];
let $highlight = jQuery(); // holder for elements in the section to be highlighted
const $highlightWrap = jQuery('<div class="section_highlight_wrapper"></div>');