[pmwiki-devel] Using "!#anchor heading" markup

Petko Yotov 5ko at 5ko.fr
Thu Jun 4 08:05:12 PDT 2026


On 04/06/2026 11:57, John Rankin wrote:
> On 04/06/2026 5:34 pm, Petko Yotov wrote:
>> Instead of a separate global variable $DuplicateAnchor, duplicate 
>> anchors are styled in pmwiki-core.css, and can be overridden in 
>> pub/css/local.css:
>> 
>>   a.visible-anchor:not([id]) {
>>     background-color: var(--pmc-yellow2);
>>   }
>> 
>> See/test: https://pmwiki.org/t/VisibleAnchors
> 
> That is quite subtle to my eyesight (the world gets yellower with age;
> YMMV).

I changed the background to brighter orange-red color. I wanted to have 
a color that is available in the core but configurable, and this one is 
in PmSyntax.

At any rate, via custom CSS a webmaster can change the colors and add 
some content before or after:

   a.visible-anchor:not([id]):before {
    content: attr(title);
    /* or: content: "\FFFD"; */ /*�*/
   }

We can even remove the $VisibleAnchor variable and configure the 
character in CSS.

> A more flexible option could be to retain $VisibleAnchor and
> $DuplicateAnchor, and SDV($DuplicateAnchor, $VisibleAnchor); in the
> core. Those who wish to, can over-ride the default.

If we can avoid adding more global variables when alternative 
configuration exists, we should. It is very painful to remove features 
people rely on.

Petko



More information about the pmwiki-devel mailing list