[pmwiki-devel] New ##idName issue Re: Using "!#anchor heading" markup

John Rankin john.rankin at affinity.co.nz
Thu Jun 11 00:52:17 PDT 2026


Thanks, Petko. I think it must be something in the way Martin (cc'd) has 
configured his site. Martin, does your site use a custom (:include:) 
recipe at all? Can you think of anything your site is doing that might 
be triggering this?

I have been unable to replicate the problem on my test site, with a now 
quite old pmwiki version. 'Include' works as Iyou would expect with 
visible anchors in my case. The pagetoc code doesn't touch the standard 
markup rule for [[#idName]]. The code that handles [[##idName]] 
basically copies the stdmarkup logic for [[#idName]], and produces 
either a visible anchor or a visible duplicate as output, depending on 
the result returned from TrackAnchors. It also turns any !!#idName or 
!!##idName into their [[...]] equivalents. So pagetoc uses the same 
processing logic as the latest pmwiki version.

So it appears there is some interaction between the latest pagetoc code 
and Martin's site configuration causing this problem, not a pagetoc / 
pmwiki core interaction. See also Martin's reply.

Does the new MarkupAnchors() function replace TrackAnchors, or will 
pagetoc's call to TrackAnchors continue to work?

JR

On 11/06/2026 6:33 pm, Petko Yotov wrote:
> I don't have this problem with the pre-release, did you update both 
> pmwiki.php and stdmarkup.php? Do you use custom markup rules 
> overriding the core anchors markups? Do you override the core 
> (:include:) markup?
>
> In stdmarkup.php there is a new MarkupAnchors() function and the 
> Markup rule changed for '[[#'.
>
> A new markup rule was added as '^!#', as we discussed, it simply 
> rewrites !!#anchor into !![[#anchor]] (also with 2 hashes).
>
> This rewrite also happens in pmwiki.php inside TextSection() when a 
> section is included. In this case, since the replacement happened 
> before the section is processed by the markup engine, the '^!#' markup 
> engine does not see !!#... in the included text, it sees !![[#...
>
> If you place your echo's in MarkupAnchors() you'll see every anchor in 
> included pages is only seen once.
>
> Petko
> <snip>



More information about the pmwiki-devel mailing list