فهرست منبع

#4852 Update outdated JS packages: toc.js

Alex Trofimov 1 سال پیش
والد
کامیت
fdf1876754
1فایلهای تغییر یافته به همراه12 افزوده شده و 0 حذف شده
  1. 12 0
      patches/plugins_public_toc-js.txt

+ 12 - 0
patches/plugins_public_toc-js.txt

@@ -0,0 +1,12 @@
+--- orig/plugins_public/toc.js	1970-01-01 03:00:00
++++ fixed/plugins_public/toc.js	2025-01-08 18:10:46
+@@ -24,7 +24,8 @@
+ 
+     function createLink (header) {
+       var innerText = (header.textContent === undefined) ? header.innerText : header.textContent;
+-      return "<a class='"+settings.classes.link+"' href='#" + fixedEncodeURIComponent(header.id) + "'>" + innerText + "</a>";
++      var href = document.location.href.replace(document.location.hash, '');
++      return "<a class='"+settings.classes.link+"' href='" + href + "#" + fixedEncodeURIComponent(header.id) + "'>" + innerText + "</a>";
+     }
+ 
+     var headers = $(settings.headers).filter(function() {