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

John Rankin john.rankin at affinity.co.nz
Thu Jun 4 13:06:26 PDT 2026


On 05/06/2026 3:05 am, Petko Yotov wrote:

> 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.
Yes that makes sense. Go for it.
>
>> 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.

It is indeed, and the pagetoc legacy code is an example.

Thanks for the good work. J

>
> Petko



More information about the pmwiki-devel mailing list