<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Before I upload a revised pagetoc.php file to the Cookbook, I'd
      like to check a couple of things.</p>
    <p>First thanks to Simon and "nitram" for their patience and help
      working through the issues with me, most of which were related to
      the "visible anchor" markup that pagetoc provides.</p>
    <p>1. [[##visibleAnchor]] now uses TrackAnchors function to detect
      duplicate ids. If it finds one, it displays � instead of § (the
      characters are user-configurable). This revealed a conflict with
      SectionEdit's use of MarkupToUnstyled, which I have fixed.</p>
    <p>2. For consistency, the recipe now tests $SeenAnchor for
      [[#anchor]] and !!#anchor to display a � for a duplicate, before
      giving control back to pmwiki to process the markup. Telling a
      writer when ##anchors are duplicates but not #anchors felt wrong
      (by Philosophy 1).</p>
    <p>3. !!##anchor heading produces a visible anchor, again for
      consistency.</p>
    <p>4. (:toc anchors=visible:) makes all anchors in the toc headings
      visible (overriding any !![[#anchor]] markup); a new option (:toc
      anchors=!visible:) hides all anchors (overriding any
      !![[##anchor]] markup), except for any duplicate ids; (:toc:)
      processes anchors as written.</p>
    <p>5. Is there a case for making duplicate anchor ids visible as
      part of the pmwiki core?</p>
    <p>6. Should I be separating out visible and duplicate anchor markup
      processing into its own separate recipe? Should such a recipe be
      an optional part of the pmwiki core?</p>
    <p>Thanks for any thoughts or advice.</p>
    <p>jr</p>
    <p>PS Simon, I'll update your site once nitram has confirmed that
      all is well.</p>
    <div class="moz-cite-prefix">On 10/04/2026 3:30 pm, Simon wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAFUSNWNG-mhc9XrcGWOLeKVR0RqSG-MciExNYcT=ngPZSuO52A@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">thank you so much.<br>
        I will follow this up with the recipe's author, who probably has
        seen this.
        <div><br>
        </div>
        <div>regards</div>
        <div><br>
        </div>
        <div>Simon</div>
      </div>
      <br>
      <div class="gmail_quote gmail_quote_container">
        <div dir="ltr" class="gmail_attr">On Thu, 9 Apr 2026 at 18:27,
          Petko Yotov <<a href="mailto:5ko@5ko.fr"
            moz-do-not-send="true" class="moz-txt-link-freetext">5ko@5ko.fr</a>>
          wrote:<br>
        </div>
        <blockquote class="gmail_quote"
style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">In
          the HTML source of the rendered page, at the start of the
          <h2> <br>
          heading elements I see anchors like <a id='toc6'>, and
          the hash sign # <br>
          is missing from the identifier. So I suspect some markup rule
          is <br>
          processing the "!!#" part to produce what looks like a
          table-of-contents <br>
          related identifier.<br>
          <br>
          When I open ?action=ruleset, I see a markup rule "^!#", it
          could be it.<br>
          <br>
          When I open ?action=diag, I see this pattern:<br>
             [^!#] => Array(<br>
               [cmd] => <links<br>
               [seq] => B>>>>><<br>
               [pat] => /^(!+|Q?:)#(#?)/<br>
               [rep] => TocAnchor<br>
             )<br>
          <br>
          This pattern matches the hash character and something else
          later <br>
          consumes it.<br>
          <br>
          So it looks like there is a TocAnchor() function that does
          this <br>
          conversion.<br>
          <br>
          Searching the cookbook, I found the recipe PageTableOfContents
          has such <br>
          a function.<br>
          <br>
          Alternatively, the page PmWiki:Troubleshooting lists a few
          simpler steps <br>
          to track what recipe could cause a bug.<br>
          <br>
          We should probably update PageTableOfContents. I don't see the
          !!# <br>
          markup documented. The pattern matches, at the start of a
          line:<br>
             !!#, !!##, Q:#, Q:##, :#, :##<br>
          <br>
          This produces an anchor like [[#toc6]] or [[##toc6]], the
          latter is <br>
          later rendered as a visible link.<br>
          <br>
          I see none of these patterns or usage documented on the recipe
          page, and <br>
          I don't know how many wikis are using these patterns.<br>
          <br>
          Petko<br>
          <br>
          -- <br>
          If you upgrade :  <a href="https://www.pmwiki.org/Upgrades"
            rel="noreferrer" target="_blank" moz-do-not-send="true"
            class="moz-txt-link-freetext">https://www.pmwiki.org/Upgrades</a><br>
          <br>
          On 09/04/2026 07:20, Simon wrote:<br>
          > After upgrading my wiki to the current version I decided
          to move to<br>
          > the new, and concise "!#anchor heading" markup.<br>
          > Viz: Kiwi wiki | Extensions / Url Get [1]<br>
          > <br>
          > However the anchors are displaying in the headings (see
          here for how<br>
          > it is supposed to look UrlGet - Cookbook - PmWiki [2])<br>
          > Naturally I checked, and redid, my upgrade.<br>
          > I can only think there is a recipe (which I will check
          next) or some<br>
          > remnant of code that needs to be deleted (but my update
          removes<br>
          > directories when it can).<br>
          > <br>
          > I'd appreciate any suggestions<br>
          > <br>
          > tia<br>
          > <br>
          > Simon<br>
          > <br>
          > Links:<br>
          > ------<br>
          > [1] <a href="https://kiwiwiki.nz/Extensions/UrlGet"
            rel="noreferrer" target="_blank" moz-do-not-send="true"
            class="moz-txt-link-freetext">https://kiwiwiki.nz/Extensions/UrlGet</a><br>
          > [2] <a
            href="https://www.pmwiki.org/wiki/Cookbook/UrlGet"
            rel="noreferrer" target="_blank" moz-do-not-send="true"
            class="moz-txt-link-freetext">https://www.pmwiki.org/wiki/Cookbook/UrlGet</a><br>
          > _______________________________________________<br>
          > pmwiki-devel mailing list<br>
          > <a href="mailto:pmwiki-devel@pmichaud.com"
            target="_blank" moz-do-not-send="true"
            class="moz-txt-link-freetext">pmwiki-devel@pmichaud.com</a><br>
          > <a
            href="http://www.pmichaud.com/mailman/listinfo/pmwiki-devel"
            rel="noreferrer" target="_blank" moz-do-not-send="true"
            class="moz-txt-link-freetext">http://www.pmichaud.com/mailman/listinfo/pmwiki-devel</a><br>
        </blockquote>
      </div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre wrap="" class="moz-quote-pre">_______________________________________________
pmwiki-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:pmwiki-devel@pmichaud.com">pmwiki-devel@pmichaud.com</a>
<a class="moz-txt-link-freetext" href="http://www.pmichaud.com/mailman/listinfo/pmwiki-devel">http://www.pmichaud.com/mailman/listinfo/pmwiki-devel</a>
</pre>
    </blockquote>
  </body>
</html>