[pmwiki-users] Setting an id-tag to a 2nd level heading and removing "name=" in anchor
design5 at softflow.co.uk
Wed Mar 23 02:48:54 CDT 2011
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.
But we should not have an anchor and a headings tag both with
the same id. So one of them needs to be modified in some fashion.
I think a markup !!#heading Heading is preferable then,
and certainly better than the markup I proposed.
Having an id in a heading tag allows it to be used in urls for
navigation, and an anchor would not be needed then.
At least that should work for modern browsers.
Adding anchors may serve to accommodate older browsers.
And anchors are used for (:include Name#anchor :) etc.
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.
More information about the pmwiki-users