commit 7fa988fbf0f5bfba31418a3e6133cf5631283be7
Author: sanda <sa...@lyx.org>
Date:   Sat May 18 10:54:10 2024 +0000

    few more php fixes
---
 farm/cookbook/pagetoc.php | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/farm/cookbook/pagetoc.php b/farm/cookbook/pagetoc.php
index 7c584ae3..5952b672 100644
--- a/farm/cookbook/pagetoc.php
+++ b/farm/cookbook/pagetoc.php
@@ -229,6 +229,7 @@ SDV($TocBackFmt,'&uarr; Contents');
 Markup('tocback','directives','/\(:toc-back(?:\s+(.*?))?:\)/',"TocLinkText");
 Markup('tocpage','directives','/\(:toc-page\s+(.*?)(?:\s+self=([01]))?:\)/',
     function ($m) use (&$pagename) {
+      SDV($m[2], '');
       return RemoteTableOfContents($pagename,$m[1],$m[2]);
     });
 
@@ -285,9 +286,11 @@ function RemoteTableOfContents($pagename,$ref,$self=0) {
     $toctext=@$tocpage['text'];
     if (strpos($toctext, '(:nogroupheader:)')===false)
         $toctext = $GLOBALS['GroupHeaderFmt'].$toctext;
-    if 
(preg_match('/\(:([#\*])?toc(?:-(float|hide))?(?:\s+anchors=(v)isible)?(?:\s+(.*?))?(?:\s+(Q))?:\)(.*)$/se',$toctext,$m))
+    if 
(preg_match('/\(:([#\*])?toc(?:-(float|hide))?(?:\s+anchors=(v)isible)?(?:\s+(.*?))?(?:\s+(Q))?:\)(.*)$/s',$toctext,$m))
         $toc = str_replace('[[#',"[[$ref#",
             TableOfContents($tocname,$m[1],'page','',$m[5],PSS($m[6])));
+    else
+       $toc = '';
     $TocHeaderFmt = $oTocHeader;
     return $toc;
 }
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to