[pmwiki-devel] Using "!#anchor heading" markup
Simon
nzskiwi at gmail.com
Thu Apr 9 20:30:50 PDT 2026
thank you so much.
I will follow this up with the recipe's author, who probably has seen this.
regards
Simon
On Thu, 9 Apr 2026 at 18:27, Petko Yotov <5ko at 5ko.fr> wrote:
> In the HTML source of the rendered page, at the start of the <h2>
> heading elements I see anchors like <a id='toc6'>, and the hash sign #
> is missing from the identifier. So I suspect some markup rule is
> processing the "!!#" part to produce what looks like a table-of-contents
> related identifier.
>
> When I open ?action=ruleset, I see a markup rule "^!#", it could be it.
>
> When I open ?action=diag, I see this pattern:
> [^!#] => Array(
> [cmd] => <links
> [seq] => B>>>>><
> [pat] => /^(!+|Q?:)#(#?)/
> [rep] => TocAnchor
> )
>
> This pattern matches the hash character and something else later
> consumes it.
>
> So it looks like there is a TocAnchor() function that does this
> conversion.
>
> Searching the cookbook, I found the recipe PageTableOfContents has such
> a function.
>
> Alternatively, the page PmWiki:Troubleshooting lists a few simpler steps
> to track what recipe could cause a bug.
>
> We should probably update PageTableOfContents. I don't see the !!#
> markup documented. The pattern matches, at the start of a line:
> !!#, !!##, Q:#, Q:##, :#, :##
>
> This produces an anchor like [[#toc6]] or [[##toc6]], the latter is
> later rendered as a visible link.
>
> I see none of these patterns or usage documented on the recipe page, and
> I don't know how many wikis are using these patterns.
>
> Petko
>
> --
> If you upgrade : https://www.pmwiki.org/Upgrades
>
> On 09/04/2026 07:20, Simon wrote:
> > After upgrading my wiki to the current version I decided to move to
> > the new, and concise "!#anchor heading" markup.
> > Viz: Kiwi wiki | Extensions / Url Get [1]
> >
> > However the anchors are displaying in the headings (see here for how
> > it is supposed to look UrlGet - Cookbook - PmWiki [2])
> > Naturally I checked, and redid, my upgrade.
> > I can only think there is a recipe (which I will check next) or some
> > remnant of code that needs to be deleted (but my update removes
> > directories when it can).
> >
> > I'd appreciate any suggestions
> >
> > tia
> >
> > Simon
> >
> > Links:
> > ------
> > [1] https://kiwiwiki.nz/Extensions/UrlGet
> > [2] https://www.pmwiki.org/wiki/Cookbook/UrlGet
> > _______________________________________________
> > pmwiki-devel mailing list
> > pmwiki-devel at pmichaud.com
> > http://www.pmichaud.com/mailman/listinfo/pmwiki-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pmichaud.com/pipermail/pmwiki-devel/attachments/20260410/038ece20/attachment.html>
More information about the pmwiki-devel
mailing list