[pmwiki-users] Setting an id-tag to a 2nd level heading and removing "name=" in anchor

Patrick R. Michaud pmichaud at pobox.com
Wed Mar 23 09:49:21 CDT 2011

On Wed, Mar 23, 2011 at 07:48:54AM +0000, Hans wrote:
> Tuesday, March 22, 2011, 7:18:18 PM, Patrick R. Michaud wrote:
> > We might also consider modifying the default markup rules 
> > so that  
> >     !![[#heading]] Heading  
> > automatically puts the id into the <h2> tag.  There might
> > be a problem with backward compatibility though (it could
> > certainly be made optional).
> I suppose you mean this should leave an anchor tag as well.

I meant instead of generating an (extra) anchor tag.

> Could the TextSection function be expanded to return a section
> with heading id instead of an anchor? I guess this would be
> difficult, as we don't know exactly where such a section should end.
> Perhaps up to the next heading with id. Or simply to the next heading.

This is why I proposed the !![[#heading]] markup -- it remains
consistent with the existing TextSection() function.  Yes, an author
would need to put an anchor on the next heading (or otherwise a [[#headingend]]
to mark the end of the section).


More information about the pmwiki-users mailing list