From 13ab2b4580a23b38da73a9a7e485882e7fe6cc8b Mon Sep 17 00:00:00 2001 From: DeltaLima Date: Thu, 22 Jun 2023 16:04:50 +0200 Subject: [PATCH] line-numbers config now done and working :) --- config.php | 2 +- res/syntaxhighlighter-ng.js | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/config.php b/config.php index 1e24469..bfa58e6 100644 --- a/config.php +++ b/config.php @@ -22,6 +22,6 @@ return [ // change here 'size' => 'small', 'theme' => 'okaidia', - 'line-numbers' => true, + 'line-numbers' => 'true', ] ?> diff --git a/res/syntaxhighlighter-ng.js b/res/syntaxhighlighter-ng.js index 49512e8..359a117 100644 --- a/res/syntaxhighlighter-ng.js +++ b/res/syntaxhighlighter-ng.js @@ -26,6 +26,12 @@ function wrap_pre_tags(used_languages, enable_line_numbers) { + if ( enable_line_numbers == true ) + { + enable_line_numbers = "line-numbers"; + } else { + enable_line_numbers = ""; + } // iterate through all used_languages for (let iUl = 0;iUl < used_languages.length; iUl++) { @@ -47,7 +53,7 @@ function wrap_pre_tags(used_languages, enable_line_numbers) { org_html = preElements[iEl].innerHTML; // put tag with 'language-' class and plugin-classes // prism.js plugin around the
 content
-      new_html = "" + org_html + "";
+      new_html = "" + org_html + "";
       // write back our new html and enjoy syntax highlightning :)
       preElements[iEl].innerHTML = new_html;
     }