[pmwiki-users] Setting an id-tag to a 2nd level heading and removing "name=" in anchor
Martin Kerz
martinkerz at gmail.com
Tue Mar 22 12:49:50 CDT 2011
Dear Hans,
thanks a lot for your suggestions. I'll try it out when I'm back home.
As for the !! markup. I actually just want to be able to add an id-tag to it.
Thanks again.
Martin
On 22.03.2011, at 18:40, Hans <design5 at softflow.co.uk> wrote:
> Tuesday, March 22, 2011, 5:21:52 PM, Martin Kerz wrote:
>
>> I need html that looks like this:
>
>> <h2 id="heading">Heading</h2>
>
> You need some kind of custom markup, as the !! markup does not
> provide a name or id setting. Not sure how different from the standard
> !, !!, !!!, etc. headings markup you like to go.
>
>> The other (minor) problem I have is that whenever I add an anchor,
>> the resulting html adds both the "name=" _and_ the "id=" tags to the
>> anchor. Can I somehow avoid setting the "name=" tag?
>
> define in config an alternative to the anchor markup:
>
> ## [[#anchor]]
> Markup('[[#','<[[','/(?>\\[\\[#([A-Za-z][-.:\\w]*))\\]\\]/e',
> "Keep(TrackAnchors('$1') ? '' : \"<a id='$1'></a>\", 'L')");
> function TrackAnchors($x) { global $SeenAnchor; return @$SeenAnchor[$x]++; }
>
> I just removed the name='$1' from the standard anchor definition.
>
>
> ~Hans
>
More information about the pmwiki-users
mailing list