<div dir="ltr"><div class="gmail_default" style="font-family:times new roman,serif;font-size:large">thank you. I will consider the new core feature, so maybe the recipe is made superfluous for me.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Am Mi., 13. Nov. 2019 um 15:56 Uhr schrieb Petko Yotov <<a href="mailto:5ko@5ko.fr">5ko@5ko.fr</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Thanks for sharing this.<br>
<br>
>  $prefix=PSS($m[1]);<br>
>  $text=PSS($m[2]);<br>
<br>
You need to remove the PSS() calls from the new version. PSS() strips <br>
one level of backslashes. It  was previously needed in markup <br>
replacements because preg_replace() with /eval added one level of <br>
backslashes. The new PHP 5.5-7.2 way doesn't add backslashes, and using <br>
PSS() may remove legitimate backslashes from the wiki text.<br>
<br>
> Maybe Petko could change this in the download-version?<br>
<br>
If the maintainer is unreachable, as the recipe is licensed GPL, you can <br>
publish the changes yourself, and even take over the maintenance of the <br>
recipe.<br>
<br>
BTW, if you also need a table of contents, the latest PmWiki version <br>
includes a new table of contents feature that can also automatically <br>
number sections, see $PmTOC['NumberedHeadings'] at this page:<br>
<br>
   <a href="https://www.pmwiki.org/wiki/PmWiki/TableOfContents" rel="noreferrer" target="_blank">https://www.pmwiki.org/wiki/PmWiki/TableOfContents</a><br>
<br>
Core numbered headings currently depend on the table of contents, but <br>
that should be refactored to become an independent function. Now, if the <br>
sections are less than 3 (configurable), there is no TOC and the <br>
headings are not numbered.<br>
<br>
Petko<br>
<br>
On 13/11/2019 15:23, Hans-Jürgen Godau wrote:<br>
> I wanted to have numbered sections in my wiki-page, so I tried the <br>
> numbered<br>
> sections recipe and noticed, it still uses the deprecated "/e" Markup. <br>
> so I<br>
> changed the source with the following diff's:<br>
> -------------------------<br>
> --- Downloads/archive/pmwiki/numberedsections.php<br>
> +++ numberedsections.php<br>
> @@ -88,8 +88,8 @@<br>
>  ##<br>
>  SDV ($DDNumFmt, '1.1.1.1.1.1');<br>
> <br>
> -Markup('dd-num1','>include','/^(!{1,6})(?:\s*)(.*)$/e',<br>
> "DDMkNumTitle(PSS('$1'),PSS('$2'))");<br>
> -Markup('dd-num2','directives','/\\(:(no)?numbered-sections(?:\s+(.*?))?:\\)/e',<br>
> "DDRunNum('$1',PSS('$2'))");<br>
> +Markup('dd-num1','>include','/^(!{1,6})(?:\s*)(.*)$/', <br>
> "DDMkNumTitle");<br>
> +Markup('dd-num2','directives','/\\(:(no)?numbered-sections(?:\s+(.*?))?:\\)/',<br>
> "DDRunNum");<br>
> <br>
>  ##<br>
>  ## If numbered sections are enabled in the group or site header or <br>
> footer,<br>
> ensure they are not inherited<br>
> @@ -101,8 +101,9 @@<br>
>  $SiteHeaderFmt = $SiteHeaderFmt.'(:nonumbered-sections:)';<br>
>  $SiteFooterFmt = '(:nonumbered-sections:)'.$SiteFooterFmt;<br>
> <br>
> -<br>
> -function DDMkNumTitle ($prefix, $text) {<br>
> +function DDMkNumTitle ($m) {<br>
> +  $prefix=PSS($m[1]);<br>
> +  $text=PSS($m[2]);<br>
>    global $DDNumFmt, $DDNumHdrEnable, $DDFmtSet, $DDDebug;<br>
>    static $FmtNb, $OrNb, $TcNb, $sp, $numoffset, $CurLvl;<br>
> <br>
> @@ -158,8 +159,10 @@<br>
>      return chr(ord($num)-1);<br>
>  }<br>
> <br>
> -function DDRunNum ($nonum, $argstr) {<br>
> +function DDRunNum ($m) {<br>
>    global $DDNumHdrEnable, $DDFmtSet, $DDNumFmt, $DDDebug;<br>
> +  $nonum = $m[1];<br>
> +  $argstr = PSS($m[2]);<br>
> <br>
>    $args = ParseArgs($argstr);<br>
> -------------------------<br>
> Maybe Petko could change this in the download-version?<br>
</blockquote></div>